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[]
Ejemplo n.º 1
0
 /**
  * Show blog.
  *
  * /blogs/{id} get
  *
  * @param  integer $id
  *
  * @return \Illuminate\View\View
  */
 public function show($id)
 {
     $blog = $this->blogs->findPublishedById($id);
     return view('blogs.show', compact('blog'));
 }