laravel-enso / tables

Bulma themed, VueJS powered Datatable with server-side loading and JSON template setup
https://www.laravel-enso.com/examples/table
632 stars 77 forks source link

readPath() problem when laravel runs in a subfolder #252

Closed ClCfe closed 3 years ago

ClCfe commented 3 years ago

This is a feature request.

Hello,

when you use route($name, $parameters = [], $absolute = false) to retrieve a named route, it won't include the parent(s) directory(ies) (here, /subfolder/)

route($name, $parameters = [], $absolute = false) returns readPath: "/users/tableData", instead of readPath: "/subfolder/users/tableData",

as a consequence, the vueJS front sends ajax to https://domain.tld/users/tableData instead of https://domain.tld/subfolder/users/tableData

The problem occurs here: https://github.com/laravel-enso/tables/blob/master/src/Services/Template/Builders/Structure.php#L99 https://github.com/laravel-enso/tables/blob/master/src/Services/Template/Builders/Filters.php#L39 https://github.com/laravel-enso/tables/blob/master/src/Services/Template/Builders/Buttons.php#L85

I see two solutions to solve this:

Thank you