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

findAllWithRelationHavePublishedVideoLimit() public method

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