appstract / laravel-blade-directives

A collection of nice Laravel Blade directives
MIT License
858 stars 75 forks source link

Enables deferring a script #55

Closed antoniancu closed 4 years ago

antoniancu commented 4 years ago

I wanted to use @script with an additional defer parameter.

This PR enables using @script('script.js', defer).

To achieve this, the directive extracts $expression into $script and $defer variables which are returned in the right place to assemble the resulting <script ....></script> tag.

gizburdt commented 4 years ago

Thanks :)