App\Repositories\CommentRepository::getById PHP Method

getById() public method

Get comment by given id.
public getById ( $id ) : mixed
$id
return mixed
    public function getById($id)
    {
        return $this->model->find($id);
    }

Usage Example

 public function getUpdate($id)
 {
     $comment = $this->commentRepository->getById($id);
     return view('weyi.comment.update', compact('comment'));
 }