App\Repositories\CommentRepository::all PHP Method

all() public method

Get all comments.
public all ( $n ) : mixed
$n
return mixed
    public function all($n)
    {
        return $this->model->orderBy('created_at', 'desc')->paginate($n);
    }

Usage Example

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $comments = $this->comment->all(10);
     $links = $comments->links();
     return view('back.comments.index', compact('comments', 'links'));
 }