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

findAllWithRelationHavePublishedVideo() public method

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