Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Laravel update data with PATCH method

I want to update my data with Laravel so I used the PATCH method but I have an error :

Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException
The GET method is not supported for route checkPermissions. Supported methods: PATCH.

I used PATCH method like this :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

My view :

    <form action="/checkPermissions" method="PATCH">
    @method('PATCH')
    @csrf

      //My fields are here

    </form>

My route :

Route::patch('/checkPermissions', [MyController::class, 'check']);

(I already check this Question The GET method is not supported for this route. Supported methods: PATCH, but there is no answers that solve the problem)

If you need to see more code or files just ask me.

Thanks for your help !

>Solution :

Form actions are only supported to get and post actions. Change the form action to post and you are already defined patch within the @method directive.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading