Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes Conflict of @js @css with L9+ #149

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 23 additions & 9 deletions src/Config/themes.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

return [

/*
|--------------------------------------------------------------------------
| Root path where theme Views will be located.
| Can be outside default views path e.g.: resources/themes
| Leave it null if you will put your themes in the default views folder
| (as defined in config\views.php)
|--------------------------------------------------------------------------
*/
/*
|--------------------------------------------------------------------------
| Root path where theme Views will be located.
| Can be outside default views path e.g.: resources/themes
| Leave it null if you will put your themes in the default views folder
| (as defined in config\views.php)
|--------------------------------------------------------------------------
*/

'themes_path' => null, // eg: base_path('resources/themes')
'themes_path' => null, // eg: base_path('resources/themes')

/*
|--------------------------------------------------------------------------
Expand Down Expand Up @@ -40,6 +40,20 @@

'cache' => false,

/*
|--------------------------------------------------------------------------
| Laravel introduced the @js directive in Laravel 9, released on February 8, 2022.
| This directive was added to simplify safely passing PHP data to JavaScript
| within Blade templates, eliminating the need for manual JSON encoding and escaping,
| which was commonly done with json_encode() in older versions.
|
| which may conflict with you if you're (or package ex: filament) using it.
| so you might want to disabled registering this package @js @jsIn @css blade directives.
|--------------------------------------------------------------------------
*/

'register_blade_directives' => true,

/*
|--------------------------------------------------------------------------
| Define available themes. Format:
Expand Down
4 changes: 3 additions & 1 deletion src/themeServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ public function boot()
| Register custom Blade Directives
|--------------------------------------------------------------------------*/

$this->registerBladeDirectives();
if(\Config::get('themes.register_blade_directives', true)) {
$this->registerBladeDirectives();
}
}

protected function registerBladeDirectives()
Expand Down