[#1] added images processing
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Image extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'aspect_ratio',
|
||||
'height',
|
||||
'iso',
|
||||
'file_path',
|
||||
'vote_average',
|
||||
'vote_count',
|
||||
'width',
|
||||
'type',
|
||||
];
|
||||
}
|
||||
@@ -47,4 +47,9 @@ class Movie extends Model
|
||||
{
|
||||
return $this->belongsToMany(Person::class, 'movie_crew', 'movie_id', 'person_id');
|
||||
}
|
||||
|
||||
public function images()
|
||||
{
|
||||
return $this->belongsToMany(Image::class, 'movie_images', 'movie_id', 'image_id');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user