2023-06-21 09:53:21 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
|
|
|
|
class Podcast extends Model
|
|
|
|
{
|
|
|
|
use HasFactory;
|
|
|
|
|
|
|
|
use SoftDeletes;
|
|
|
|
|
|
|
|
protected $table = 'podcasts';
|
|
|
|
|
|
|
|
protected $dates = ['created_at', 'updated_at', 'deleted_at', 'added_at'];
|
|
|
|
|
2023-12-14 12:33:03 -05:00
|
|
|
protected $casts = [
|
|
|
|
'created_at' => 'datetime',
|
|
|
|
'updated_at' => 'datetime',
|
|
|
|
'deleted_at' => 'datetime',
|
|
|
|
'added_at' => 'datetime',
|
|
|
|
];
|
|
|
|
|
2023-06-21 09:53:21 -04:00
|
|
|
public function episodes()
|
|
|
|
{
|
|
|
|
return $this->hasMany(Episode::class);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function artists()
|
|
|
|
{
|
|
|
|
return $this->hasManyThrough(Artist::class, Episode::class);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|