When i submit a post form on my page it doesn't work, it redirects me on the action route with error 419, this is an example of my form:
<form action="{{route('client.login')}}" method="POST">
@csrf
@method('POST')
<h4 >Login</h4>
<div >
<div >
<div >
<label>Email*</label>
<input type="email" name="email" value="{{ old('email') }}">
</div>
<div >
<label>Password</label>
<input type="password" autocomplete="current-password" name="password"
value="{{ old('password') }}">
</div>
<div >
<div >
<button type="submit" >Login</button>
<div >
<input type="checkbox" id="remember" name="remember" >
<label for="remember" >Ricordami</label>
</div>
</div>
@if (Route::has('password.request'))
<p><a href="{{ route('password.request') }}" >Password dimenticata?</a></p>
@endif
</div>
</div>
</div>
</form>
I've checked the csrf tokens, and they match. I've the exact same code on my server-side files and they work perfectly, but doesn't work on my local server. I can't find anywhere the log of this error.
EDIT: My issue was in the .env file, I’ve written a ; rather than a :
CodePudding user response:
Remove @method('POST')
this line and try because you don't need to mention method="POST"
, you already mentioned method in form tag.
Welcome you in advance.
CodePudding user response:
Try to add <meta name="csrf-token" content="{{ csrf_token() }}">
in the head of app.blade.php
file