I am trying to use pagination in laravel. so i try to retrieve all the transactions and paginate it. my flow goes like this for your reference view->controller->repository->model .
myrepository:
public function getall(){
$this->transaction = Transaction::all();
return $this->transaction;
}
mycontroller:
public function getall(){
$transactions = $this->transaction->getall()->paginate(10);
//dd($this->transaction);
return view('transactions', ['transactions' => $transactions]);
}
in my app.php under service providers i made sure i have pagination: Illuminate\Pagination\PaginationServiceProvider::class,
but there is no aliases though. so in my controller i did : use Illuminate\Pagination;