Estado inicial: frontend React + backend Laravel
This commit is contained in:
31
plataforma-tutorias/app/Models/Video.php
Normal file
31
plataforma-tutorias/app/Models/Video.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?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');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user