Initial Commit; base feats

This commit is contained in:
Didier Slof 2022-11-23 09:32:34 +01:00
commit 9732135e90
Signed by: didier
GPG key ID: 01E71F18AA4398E5
137 changed files with 13856 additions and 0 deletions

39
app/Models/Rating.php Normal file
View file

@ -0,0 +1,39 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Rating extends Model
{
protected $table = 'ratings';
protected $primaryKey = 'rating_id';
public $timestamps = false;
protected $fillable = [
'movie_id',
'user_id',
'rating_value',
];
protected $hidden = [
'created_at',
'updated_at',
];
protected $casts = [
'rating_value' => 'decimal:1',
];
public function movie()
{
return $this->belongsTo(Movie::class, 'movie_id', 'movie_id');
}
public function user()
{
return $this->belongsTo(User::class, 'user_id', 'user_id');
}
}