The GET method is not supported for this route. Supported methods: PUT.in laravel

the get method is not supported for this route supported methods post laravel postman
the get method is not supported for this route supported methods post route
the post method is not supported for this route. laravel ajax
the patch method is not supported for this route. supported methods: post. in laravel
the get method is not supported for this route. supported methods: patch.
the patch method is not supported for this route. supported methods: get, head.
route get function in laravel
message the post method is not supported for this route supported methods put

this is my form with the method PUT but instead it gives me an error

The GET method is not supported for this route. Supported methods: PUT.

<form action="{{ route('accounts.update', $user->id) }}" method="put" role="form" name="_method">
     @csrf
     @method('PUT')

     <div class="form-group row">
        <label for="balance" class="col-md-4 col-form-label text-md-right">{{ __('Enter Client\'s Balance  :') }}</label>
        <div class="col-md-6">
          <input id="balance" type="text" class="form-control @error('balance') is-invalid @enderror" name="balance" value=""  autocomplete="balance" autofocus>
        </div>
     </div>
     <div class="form-group row">
        <label for="amount" class="col-md-4 col-form-label text-md-right">{{ __('Enter Client\'s Amount:') }}</label>
        <div class="col-md-6">
          <input id="amount" type="text" class="form-control @error('amt') is-invalid @enderror" name="amt" value="" required autocomplete="amt" autofocus>
        </div>
     </div>
     <!-- /.card-body -->

     <div class="card-footer text-center">
        <button type="submit" class="btn btn-primary">Update Account</button>
     </div>
</form>

and this is the route file

Route::get('/accounts/{id}/edit', 'AccountsController@edit')->name('accounts.edit');
Route::put('/accounts/{id}', 'AccountsController@update')->name('accounts.update');

<form action="{{ route('accounts.update', $user->id) }}" method="post">
              @csrf
              @method('PUT')

                    <div class="form-group row">
                        <label for="balance" class="col-md-4 col-form-label text-md-right">{{ __('Enter Client\'s Balance  :') }}</label>
                        <div class="col-md-6">
                            <input id="balance" type="text" class="form-control @error('balance') is-invalid @enderror" name="balance" value=""  autocomplete="balance" autofocus>
                        </div>
                    </div>
                    <div class="form-group row">
                        <label for="amount" class="col-md-4 col-form-label text-md-right">{{ __('Enter Client\'s Amount:') }}</label>
                        <div class="col-md-6">
                            <input id="amount" type="text" class="form-control @error('amt') is-invalid @enderror" name="amt" value="
                            " required autocomplete="amt" autofocus>
                        </div>
                    </div>
                <!-- /.card-body -->

                <div class="card-footer text-center">
                  <button type="submit" class="btn btn-primary">Update Account</button>
                </div>
              </form>

The GET method is not supported for this route. Supported methods , Supported methods: POST. Posted 1 year ago by irankhosravi. Look at my codes. web.php. Route::post('/� The GET method is not supported for this route. Supported methods: PUT. The thing is, i got 2 edit.blade.php, under different folder but directing to the same controller.

I think you should remove name="_method" attribute from your form tag because it's reserved by laravel for hidden inputs

example :

<input type="hidden" name="_method" value="PUT"> // same as  @method('PUT')

see : https://laravel.com/docs/5.7/routing#form-method-spoofing

How to fix "The GET method is not supported for this route , HTTP verbs like PUT are generally not supported by the webservers, Laravel achieves this using method spoofing, so you'll need to pass an input type=hidden specifying the method you want to use. And your form action needs to "POST" for the same reason. When using the Laravel resource method on a route, it makes things pretty specific in terms of what it is expecting. If you take a look at the chart on the manual, it is looking for a uri with the updating element id returned as part of the uri. The example looks like: /photos/{photo}. I'm not sure that this is how you've structured your html form.

HTML form is not supporting PUT/PATCH method. So when you want to perform PUT/PATCH action using HTML form in Laravel, you have to add @method('put') and set form method as method="post". So you can change your code as:

<form action="{{ route('accounts.update', $user->id) }}" method="post">
   @csrf
   @method('PUT')
   ....
</form>

The GET method is not supported for this route. Supported , The GET method is not supported for this route. Supported methods: POST I am trying to get a response in dev.site.com.br/api/auth/me and I have the error this route. Supported methods: POST - Laravel 5.8 on Jul 9, 2019. pereiracinthiag changed the title The GET method is not supported for this route. Supported methods: POST The GET method is not supported for this route. Supported methods: POST - Laravel 5.8 Jul 9, 2019

The GET method is not supported for this route � Issue #2718 , Supported methods: PUT, DELETE." } What I The GET method is not supported for this route #2718 Backpack, Laravel, PHP, DB version. Symfony \ Component \ HttpKernel \ Exception \ MethodNotAllowedHttpException The GET method is not supported for this route. Supported methods: POST. Please sign in or create an account to participate in this conversation.

"POST Method Not Supported For This Route" : laravel, Supported methods: GET, HEAD, PUT, PATCH, DELETE." I'm not really sure what's going on, but I know that it *SHOULD* support it; when I php artisan route: list� I'm following a tutorial of Laravel, but I've an error: The GET method is not supported for this route. Supported methods: POST. The code of web.php

The POST method is not supported for this route. Supported , Supported methods: GET, HEAD. i have no clue where it comes from as i am pretty new to laravel. routes(web.php): Route::group(['middleware' => 'auth'], function Step 2: Then remove the #method('PUT') in your form, so let's say we'll just� Note: Since HTML forms only support POST and GET, PUT and DELETE methods will be spoofed by automatically adding a _method hidden field to your form. In your case, method was not set as it's route accept PATCH method, so please check your @method('PATCH') directive echoed associative input element in your form as expected as follows

Comments
  • Whats the difference between edit/update?
  • edit is where the form view is while update perform the function that update the account
  • I assume it's calling the other method.
  • this is the method for the update; public function update(StoreAccountsRequest $request, $id) { $user = User::findOrFail($id); $user->Accounts()->update($request->except('_method', '_token')); return redirect()->route('accounts.index')->with(['message' => 'Accounts updated successfully']); }
  • Thanks for this answer. Perhaps add a comment as to how your solution works. This might help future users of SO to understand your answer better and will give you likely more upvotes :-)
  • In form processing with the PUT method, you just need to define the post method on the form element and use @method ('PUT') inside the form element
  • @AmadouBAH having issue updating table i'm using this controller public function update(StoreAccountsRequest $request, $id) { $user = User::findOrFail($id); Accounts::where('user_id','$user') -> update(['balance' => $request->balance, 'amt' => $request->amt]); return redirect()->route('accounts.index')->with(['message' => 'Accounts updated successfully']); }
  • @TobyNwude use this code public function update(StoreAccountsRequest $request, $id) { $user = User::findOrFail($id); Accounts::where('user_id', $user->id)->update(['balance' => $request->balance, 'amt' => $request->amt]); return redirect()->route('accounts.index')->with(['message' => 'Accounts updated successfully']); } replace Accounts::where('user_id','$user') by this Accounts::where('user_id', $user->id)