You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and dots ('.'), can be up to 35 characters long. Letters must be lowercase.
36 lines
641 B
36 lines
641 B
<?php |
|
|
|
namespace App\Models; |
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory; |
|
use Illuminate\Database\Eloquent\Model; |
|
|
|
class Article extends Model |
|
{ |
|
use HasFactory; |
|
|
|
protected $fillable = [ |
|
"title", |
|
"description", |
|
"content", |
|
"user_id", |
|
"album_id", |
|
"created_at", |
|
"updated_at" |
|
]; |
|
|
|
public function album() |
|
{ |
|
return $this->belongsTo(Album::class); |
|
} |
|
|
|
public function user() |
|
{ |
|
return $this->belongsTo(User::class); |
|
} |
|
|
|
public function images() |
|
{ |
|
return $this->belongsToMany(Image::class, "images_articles"); |
|
} |
|
}
|
|
|