Debug School

rakesh kumar
rakesh kumar

Posted on

Larevel:The POST method is not supported for this route. Supported methods: GET, HEAD. Laravel

the-post-method-is-not-supported-for-this-route-supported-methods-get-head-l

<form method="post" enctype="multipart/form-data">
         @csrf
                  <div class="input-group mb-3">

                     <input type="text" class="form-control" name="username" placeholder="Instagram @username"
                        aria-label="Recipient's username" aria-describedby="basic-addon2">
                     <div class="input-group-append">
                        <button type="submit" id="ajaxSubmit" class="btn btn-success">Show Analytics</button>
                     </div>
                  </div>
               </form>
Enter fullscreen mode Exit fullscreen mode

Solution

<form method="post" enctype="multipart/form-data">
                  <div class="input-group mb-3">
                     @csrf
                     <input type="text" class="form-control" name="username" placeholder="Instagram @username"
                        aria-label="Recipient's username" aria-describedby="basic-addon2">
                     <div class="input-group-append">
                        <button type="submit" id="ajaxSubmit" class="btn btn-success">Show Analytics</button>
                     </div>
                  </div>
               </form>
Enter fullscreen mode Exit fullscreen mode

or

add @method('PUT') on the form
Enter fullscreen mode Exit fullscreen mode

exp:

<form action="..." method="POST">

@csrf  

@method('PUT')



</form>
Enter fullscreen mode Exit fullscreen mode

Top comments (0)