// in Item.php
protected $fillable = ['title', 'session_id', 'series_no', 'desc', 'image_url', 'aws_video_url'];
public function series()
{
return $this->belongsTo(Series::class, 'series_id');
}
// in Series.php
public function items()
{
return $this->hasMany(Item::class, 'series_id');
}
// in Session.php
public function items()
{
return $this->hasMany('App\Item', 'session');
}
it's okey when I fetch result from any single model.
I think I have some similar code somewhere in beetv movie app which is also one of the finest movie app that also provide tv shows, series, serials under separate categories which are actually well categorised.