32 lines
587 B
PHP
32 lines
587 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use App\Models\Category;
|
|
|
|
class Video extends Model
|
|
{
|
|
use HasFactory;
|
|
protected $table = 'videos';
|
|
protected $fillable = [
|
|
'title',
|
|
'description',
|
|
'url',
|
|
'thumbnail',
|
|
'duration',
|
|
'tags',
|
|
'is_active',
|
|
];
|
|
|
|
protected $casts = [
|
|
'is_active' => 'boolean',
|
|
];
|
|
|
|
public function categories()
|
|
{
|
|
return $this->belongsToMany(Category::class, 'video_category');
|
|
}
|
|
}
|