Learner\Repositories\Eloquent\SeriesRepository::findAllWithRelationBySlug PHP Method

findAllWithRelationBySlug() public method

Return series and relation by slug. (video is published.)
public findAllWithRelationBySlug ( $slug ) : Illuminate\Database\Eloquent\Collection | Series[]
return Illuminate\Database\Eloquent\Collection | Learner\Models\Series[]
    public function findAllWithRelationBySlug($slug)
    {
        return $this->model->with('categories')->with(['videos' => function ($query) {
            $query->where('published_at', '<=', Carbon::now());
        }])->whereSlug($slug)->firstOrFail();
    }