The project I am working on currently has this snippet of code:
<code>@if (isset($scripts) && is_array($scripts))
@foreach ($scripts as $script)
<script src="{{ $script }}"></script>
@endforeach
@endif
</code>
<code>@if (isset($scripts) && is_array($scripts))
@foreach ($scripts as $script)
<script src="{{ $script }}"></script>
@endforeach
@endif
</code>
@if (isset($scripts) && is_array($scripts))
@foreach ($scripts as $script)
<script src="{{ $script }}"></script>
@endforeach
@endif
Every time I make some changes and save the file, I have to wait more than 30 seconds while I get a lot of what seems like logs, and it ends in these two errors:
<code>PHP 66. IlluminateViewCompilersBladeCompiler->hasEvenNumberOfParentheses($expression = '@if (isset($scripts) && is_array($scripts)') /Users/[user]/Documents/GitHub/[repo]/vendor/laravel/framework/src/Illuminate/View/Compilers/BladeCompiler.php:541
PHP 67. token_get_all($code = '<?php @if (isset($scripts) && is_array($scripts)') /Users/[user]/Documents/GitHub/[repo]/vendor/laravel/framework/src/Illuminate/View/Compilers/BladeCompiler.php:606
</code>
<code>PHP 66. IlluminateViewCompilersBladeCompiler->hasEvenNumberOfParentheses($expression = '@if (isset($scripts) && is_array($scripts)') /Users/[user]/Documents/GitHub/[repo]/vendor/laravel/framework/src/Illuminate/View/Compilers/BladeCompiler.php:541
PHP 67. token_get_all($code = '<?php @if (isset($scripts) && is_array($scripts)') /Users/[user]/Documents/GitHub/[repo]/vendor/laravel/framework/src/Illuminate/View/Compilers/BladeCompiler.php:606
</code>
PHP 66. IlluminateViewCompilersBladeCompiler->hasEvenNumberOfParentheses($expression = '@if (isset($scripts) && is_array($scripts)') /Users/[user]/Documents/GitHub/[repo]/vendor/laravel/framework/src/Illuminate/View/Compilers/BladeCompiler.php:541
PHP 67. token_get_all($code = '<?php @if (isset($scripts) && is_array($scripts)') /Users/[user]/Documents/GitHub/[repo]/vendor/laravel/framework/src/Illuminate/View/Compilers/BladeCompiler.php:606
If I remove the above code and save the code, it reloads instantly.
Same with trying to add Blade directives like @if, @foreach, even though the number of parentheses seems correct. What can I do to fix this?