![what is openapi and why should you use it? | Lava Lamp Lab what is openapi and why should you use it?](https://lavalamplab.b-cdn.net/wp-content/uploads/2020/04/What-is-OpenAPI-and-why-should-you-use-it.jpg)
What Is OpenAPI And Why Should You Use It?
April 7, 2020![laravel accessors and mutators | Lava Lamp Lab laravel accessors and mutators](https://lavalamplab.b-cdn.net/wp-content/uploads/2020/05/Laravel-Accessors-and-Mutators.jpg)
Laravel: Accessors And Mutators
May 11, 2020![databases in laravel | Lava Lamp Lab databases in laravel](https://lavalamplab.b-cdn.net/wp-content/uploads/2020/04/databases-in-laravel.jpg)
When creating a web app it usually involves creating a dashboard and a place for the user to see data pertaining to their company. You can create a normal table like below but then you will have to add your own sorting and searching functionalities.
Name | Surname | Account Type |
---|---|---|
Rayne | Logan | Admin |
That is why I like to use Datatables.net they easy to use and have a lot of different add-ons.
Steps on installing the basic Datatables into your Laravel app:
-
- resources/views/layouts/app.blade.php
- On your view that you will be displaying the table
- Now you have a Datatable implemented on your site.
- resources/views/layouts/app.blade.php
Note: If you have multiple tables on one view make sure that each of them has a different id and that you have called the function in your script tags for each table.
Addons that I use frequently:
- StateSave:
- Whenever your user comes back to the page the datatable remembers the state they left it in (eg. what was sorted).
- File Export:
- Adds buttons - to print; export as a pdf, csv or excel; and copy - above your table.
- Regex Search:
- I used this to allow my users to search for multiple terms separated by a space or a comma.
Happy coding!