appstract / laravel-blade-directives

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

Error if pushonce group-name contains dash "-" #32

Closed uyab closed 6 years ago

uyab commented 6 years ago

Blade

@pushonce('end:popup-jenis')
<script>
    alert('once');
</script>
@endpushonce

Parse error: syntax error, unexpected '='

Code generated:

<?php if(! isset($__env->__pushonce_end_popup-jenis)): $__env->__pushonce_end_popup-jenis = 1; $__env->startPush('end'); ?>
ovanschie commented 6 years ago

Fixed in 0.7.1

fhusquinet commented 6 years ago

Hi!

The error also happens if the stack contains a dash, for example @pushonce ('pre-scripts:my-file') will break.

Would be great to be able to do so for readability :)

ovanschie commented 6 years ago

@fhusquinet fixed in 1.0