k4vouras
5 months ago
458
7
Laravel

When I add method('patch') in my view I get syntax error

Posted 5 months ago by k4vouras

I am following a tutorial for laravel and in order to edit the profile of a user it used a patch method. The form was copied from another view that was working as intended. Now when I open the Edit profile view without the line of method('patch') it opens as expected. When I add the patch method I get a syntax error regarding this line

class="form-control{{$errors->has('title') ? 'is-invalid' : ''}}"

with an error message of

syntax error, unexpected 'title' (T_STRING), expecting ',' or ')' (View: \resources\views\profiles\edit.blade.php)

Even when I deleted all elements in the form regarding error handling it still produced an error of unexpected layouts in the last line of the file

@endsection

Should I rewrite the view from scratch without following the tutorial or is there an easy fix for this kind of problem?

Please sign in or create an account to participate in this conversation.