Populate table with jQuery + Ajax in Laravel 5.x in 4 Steps

First Step: Route

You need to specify which controller the data will come from. This is not the index, but a custom function in your controller that contains process that will create data.

In your route.php for older version, or web.php in newer version of laravel add this line of code.

Okay let me get this clear, {data?} is a custom parameter identifier in the route. You MAY NOT be needing this in your app, and it will really depend on where you want it and depends with your style.  And please, you need to specify the index as well, its up to you.

So the data that will process my request is in the custom function named dtrDatatable in my EmployeesController. I can access that function using the URL provided.

Sharing is caring!