Init
This commit is contained in:
34
app/Models/Watched.php
Normal file
34
app/Models/Watched.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Watched extends Model
|
||||
{
|
||||
public $table = 'watched';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected $fillable = ['episode_id', 'user_id'];
|
||||
|
||||
/**
|
||||
* Get the Episode.
|
||||
*/
|
||||
public function episode(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Episode::class, 'episode_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the User.
|
||||
*/
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'user_id');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user