appstract / laravel-blade-directives

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

`pushonce` to support real expressions. #34

Closed danrichards closed 6 years ago

ovanschie commented 6 years ago

Please provide some details and examples

danrichards commented 6 years ago

The expression should be resolved to a string. Then you may determine if and where it should be pushed.

For instance, you may benefit from having a variable in your expression. Which doesn't work with the current implementation.

@pushonce("scripts:modal-product-{$product->getKey()}"
...
@endpushonce
danrichards commented 6 years ago

Going to do more testing and put this back up later.