Learner\Repositories\Eloquent\NewsletterRepository::findPublishedWithRelationById PHP Метод

findPublishedWithRelationById() публичный Метод

Find published newsletter by id.
public findPublishedWithRelationById ( integer $id ) : Illuminate\Contracts\Pagination\LengthAwarePaginator
$id integer
Результат Illuminate\Contracts\Pagination\LengthAwarePaginator
    public function findPublishedWithRelationById($id)
    {
        return $this->model->with(['links' => function ($query) {
            return $query->orderBy('type');
        }])->where('is_published', 1)->findOrFail($id);
    }