mercredi 7 août 2019

Laravel 5.8 @csrf and @method not working

When using the @csrf and the @method('') it shows correctly on the page code but doesn't work. Either fails with 419 error or the original method isn't allowed for this page type error.

Using the "old" code seems to work


            @csrf

            


            @if(isset($post))

                @method('PUT')

                

            @endif

The csrf_field and method_field options work eventhough they show the same values in the page code 

 <input type="hidden" name="_token" value="hTLipJaANmyR2I9VPyF7QvUKDiQlte7BAoRLjqeN">
AND             
<input type="hidden" name="_token" value="hTLipJaANmyR2I9VPyF7QvUKDiQlte7BAoRLjqeN">



<input type="hidden" name="_method" value="PUT"> 
AND
<input type="hidden" name="_method" value="PUT">



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire