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);
    }