Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel pagination

//controller function to return view
public function index()
    {
        $data = ModelName::where(condition)->paginate(5);
        return view('viewPath', compact('data'));
    }
    
//paste this in view, where pagination to be display
{{$data->links()}}
Source by laravel.com #
 
PREVIOUS NEXT
Tagged: #laravel #pagination
ADD COMMENT
Topic
Name
3+5 =