fix(ShowModel): added playlist relationship
This commit is contained in:
parent
b20ce2ff0d
commit
ac09ea089f
1 changed files with 7 additions and 1 deletions
|
@ -2,11 +2,13 @@
|
|||
|
||||
namespace App\Models\Show;
|
||||
|
||||
use App\Models\Playlist;
|
||||
use App\Models\ShowInstances\ShowInstances;
|
||||
use App\Models\SmartBlock;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class Show extends Model
|
||||
|
@ -59,7 +61,6 @@ class Show extends Model
|
|||
return $this->hasMany(ShowHosts::class, 'show_id');
|
||||
}
|
||||
|
||||
|
||||
public function showInstances()
|
||||
{
|
||||
return $this->hasMany(ShowInstances::class, 'show_id');
|
||||
|
@ -69,4 +70,9 @@ class Show extends Model
|
|||
{
|
||||
return $filters->apply($query);
|
||||
}
|
||||
|
||||
public function playlist()
|
||||
{
|
||||
return $this->belongsTo(Playlist::class, 'autoplaylist_id', 'id');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue