Initial Commit; base feats
This commit is contained in:
commit
9732135e90
137 changed files with 13856 additions and 0 deletions
37
app/Models/Movie.php
Normal file
37
app/Models/Movie.php
Normal file
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Movie extends Model
|
||||
{
|
||||
|
||||
protected $table = 'movies';
|
||||
protected $primaryKey = 'movie_id';
|
||||
public $timestamps = false;
|
||||
protected $fillable = [
|
||||
'movie_name',
|
||||
'movie_description',
|
||||
'movie_year',
|
||||
'movie_image',
|
||||
'user_id', // who added the movie?
|
||||
'genre_id', // which genre is the movie?
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
|
||||
public function genre()
|
||||
{
|
||||
return $this->belongsTo(MovieGenre::class, 'genre_id', 'genre_id');
|
||||
}
|
||||
|
||||
public function showings()
|
||||
{
|
||||
return $this->hasMany(Showing::class, 'movie_id', 'movie_id');
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue