@jestudillo, You have a blade directive in your controller?
Oct 31, 2022
8
Level 1
syntax error, unexpected end of file, expecting "elseif" or "else" or "endif"
Hello, my friends. I have this error.
ParseError PHP 8.1.6 LARAVEL 9.37.0 syntax error, unexpected end of file, expecting "elseif" or "else" or "endif"
My function is STORE is the following.
public function store(Request $request) { // $validated = $request-> validate ([ 'name' => 'required|unique:products|max:255', 'price' => 'required|numeric|min:0',
@if ($errors->any())
<div class="bg-red-100 border border-red-400 text-red-700 px-4 py-3 mb-4 rounded relative"
role="alert">
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
Product::create($validated);
]);
return redirect()->route('products.index');
}
Can you help me, please. Regards,
Juan Carlos
Please or to participate in this conversation.