Paul Couture
c4398c641e
Prepping for launch. Reviewed-on: #1 Co-authored-by: Paul Couture <paul@paulcouture.com> Co-committed-by: Paul Couture <paul@paulcouture.com>
46 lines
890 B
PHP
46 lines
890 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
class Overlay extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
use SoftDeletes;
|
|
|
|
protected $table = 'overlays';
|
|
|
|
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
|
|
|
|
protected $casts = [
|
|
'created_at' => 'datetime',
|
|
'updated_at' => 'datetime',
|
|
'deleted_at' => 'datetime',
|
|
];
|
|
|
|
public function artist()
|
|
{
|
|
return $this->belongsTo(Artist::class);
|
|
}
|
|
|
|
public function artworks()
|
|
{
|
|
return $this->belongsToMany(Artwork::class);
|
|
}
|
|
|
|
public function postcast()
|
|
{
|
|
return $this->belongsTo(Podcast::class);
|
|
}
|
|
|
|
public function episodes()
|
|
{
|
|
return $this->hasManyThrough(Episode::class, Artwork::class);
|
|
}
|
|
|
|
}
|