Learner\Repositories\Eloquent\BlogRepository::findPublishedById PHP Method

findPublishedById() public method

Get published blog by id.
public findPublishedById ( integer $id ) : Illuminate\Database\Eloquent\Collection | Blog[]
$id integer
return Illuminate\Database\Eloquent\Collection | Learner\Models\Blog[]
    public function findPublishedById($id)
    {
        return $this->model->where('is_published', 1)->whereId($id)->firstOrFail();
    }