Skip to content

[Bug]: Problem with using Laravel in subdirectory / script_base_path #2310

@cthiele-mogic

Description

@cthiele-mogic

What happened?

When my laravel project is in a subdirectory, the injection of styles and css does not work properly.

APP_URL=http://domain.de/subdirectory/
In livewire-tables.php configuration
'script_base_path' => '/subdirectory/rappasoft/laravel-livewire-tables'

In frontend it is fine:

<link href="/subdirectory/rappasoft/laravel-livewire-tables/core.min.css" rel="stylesheet" />

But the route to assets (see RappasoftFrontendAssets.php) is registered with the the subdirectory path which is wrong, because my APP_URL already consists subdirectory. If you call http://domain.de/subdirectory/subdirectory/rappasoft/laravel-livewire-tables/core.min.css it works and the css is returned.

How to reproduce the bug

Use APP_URL with subdirectory and enter this subdirectory path in livewire-tables.php > script_base_path

Package Version

3.7.3

PHP Version

8.2.x

Laravel Version

12.39.0

Alpine Version

No response

Theme

Tailwind 3.x

Notes

No response

Error Message

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions