Advanced Datatables with Laravel: Five Code Examples

Founder of QuickAdminPanel
In our QuickAdminPanel we use a package called Datatables.net quite a lot – it’s really good to show tables of data. But on top of our generator you can extend it, we will show you how.
We’ve just launched a new demo-project on GitHub to show you five examples of the advanced usage of Datatables with AJAX loading and package Yajra/Laravel-Datatables.
Example 1. Row details
Example 2. Master details
Example 3. Search for each individual columns (see on the bottom)
Example 4. Row attributes
Example 5. Carbon formatting (See updated_at column)
You can see all the source code in this repository.
All examples are based on the official documentation – you can find more advanced techniques there.
Try our QuickAdminPanel generator!
9 Comments
Leave a Reply Cancel reply
Recent Posts
Try our QuickAdminPanel Generator!
How it works:
1. Generate panel online
No coding required, you just choose menu items.
2. Download code & install locally
Install with simple "composer install" and "php artisan migrate".
3. Customize anything!
We give all the code, so you can change anything after download.
Thank you Sue.It helped me alot
How about if we want a custom dropdown filter that filters the Eleqouent model e.g a status field. How would you implement that in datatables?
Hi Shabaz,
That’s a big question that is impossible to answer in a simple comment. Possibly topic for the next article, we’ll keep that in mind.
Can you show in those examples when you click on a row, that the details open in a modal window? Modal should be separate blade temp,ate
Hi Niels,
That’s a big question that is impossible to answer in a simple comment. Possibly topic for the next article, we’ll keep that in mind.
Thanks a lot for this article and github examples!
I want to filter data using the getAttribute created data in datatable, how can this be done .
example i have Projects, and projectsSupervisors tables, i want to filter project based on the supervisor .
Thanks a lot! This really helped!
Hi, thanks a lot for this. But I have some confusion, is it really good practice to write/return HTML code into Controller? Also if I have some custom-designed table then it needs to write so much HTML code into the Controller. Another problem is for relational search its needs to change Query with checking if there is any request for the search. Is there any better solution for this relational searching?