23 lines
602 B
PHP
23 lines
602 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Modules\Movies\Models;
|
||
|
|
|
||
|
|
use Illuminate\Database\Eloquent\Model;
|
||
|
|
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
||
|
|
|
||
|
|
class Studio extends Model
|
||
|
|
{
|
||
|
|
use HasFactory;
|
||
|
|
protected $table = 'studios';
|
||
|
|
protected $fillable = ['name'];
|
||
|
|
|
||
|
|
public function movies(): BelongsToMany { return $this->belongsToMany(Movie::class, 'movie_studio'); }
|
||
|
|
|
||
|
|
protected static function newFactory(): Factory
|
||
|
|
{
|
||
|
|
return \Database\Factories\StudioFactory::new();
|
||
|
|
}
|
||
|
|
}
|