I’ve updated the packages of my laravel project with "composer update", but after the update i have this error : syntax error, unexpected token "endfor".
<div wire:loading.remove wire:target="lieuDepart">
@foreach ($lieuxDepart->where('type','Aéroport') as $lieu)
<p wire:loading.remove wire:click="appliquerLieuDepart('{{ $lieu->nom }}','{{ $lieu->id }}')"
x-on:click="lieuDepart='{{ $lieu->nom }}'"
class="truncate px-2 py-2 cursor-pointer hover:bg-teal-100">
{{ $lieu->nom }}
</p>
@endforeach
</div>
here’s the code.
When i comment out the @foreach loop, it works fine.
I tried to rollback the update but it doesn’t work.
Any solution please ?
Here’s the full error in my debug bar :
[09:40:07] LOG.error: syntax error, unexpected token "endfor" {
"view": {
"view": "C:\wamp64\www\Projets\DriveEase\resources\views\livewire\form-accueil.blade.php",
"data": {
"errors": "<pre class=sf-dump id=sf-dump-2146158752 data-indent-pad=" "><span class=sf-dump-note>Illuminate\Support\ViewErrorBag</span> {<a class=sf-dump-ref>#1565</a><samp data-depth=1 class=sf-dump-expanded>n #<span class=sf-dump-protected title="Protected property">bags</span>: []n</samp>}n</pre><script>Sfdump("sf-dump-2146158752", {"maxDepth":3,"maxStringLength":160})</script>n"
}
},
"exception": {}
}
3
Answers
Problem solved !
I went to recover the older versions of composer.json and composer.lock from github :
And recovered the previous version :
After that, I committed the files, pushed and downgraded the packages with :
Thanks to @DarkBee and @TufayalHossinEmon for their contribution.
Ensure this query
$lieuxDepart->where('type', 'Aéroport')
successfully fetches data.Hopefully, it returns empty or null. Debug that.
if it doesn’t return any data, you may replace your code with the code below. I hope it will solve your problem.
OR
exactly same boat as you … did you find which package causes this ?