Routes Methods


setGetRoute Method

use it to set a custom route to get data from. in the route controller method you can just return this helper function and pass your model to it dataTableOf(User::class).

$datatable->setGetRoute('/custom-route');

setStoreRoute Method

use it to set a route to send form store data to it. the first parameter is for the route and the second for the route method, by default its POST.

$datatable->setStoreRoute('/store-route');

setUpdateRoute Method

use it to set a route to send form update data to it. the first parameter is for the route , and the second for the route method, by default it's PATCH. route parameters must be written between two columns || and these parameters will be replaced with the value from the row we are modifying Also with the request you will get a request key called findBy whose value in this case will be id and you can change the findBy request key name with this method setRequestFindByKeyName("newFindByKey").

$datatable->setUpdateRoute(route('update-route', '|id|'));

setDeleteRoute Method

use it to set a route to send form delete data to it. the first parameter is for the route , and the second for the route method, by default it's DELETE. route parameters must be written between two columns || and these parameters will be replaced with the value from the row we are deleting you will also get the request key findBy with the request as in the above example.

$datatable->setDeleteRoute(route('delete-route', '|id|'));