dimanche 9 février 2020

how can i fix "The GET method is not supported for this route. Supported methods: POST."

a you see my codes every things is right about my route and form but i receive this error

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

 <form action="" method="POST">
                            
                            <input name="amount" type="hidden" value="">
                            <div class="cart_navigation"><a class="continue-btn" href="#"><i
                                            class="fa fa-arrow-left"> </i>&nbsp; خرید را ادامه دهید</a> <a
                                        class="checkout-btn" href=""><i
                                            class="fa fa-check"></i> ادامه به
                                    پرداخت</a>
                            </div>
                        </form>

my route: `route::post('/savecheckout','BasketController@checkout')->name('save.checkout');

and my function:

 public function checkout(Request $request){

   $user=auth()->user()->id;
   $order=new order();
   $order->user_id=$user;
   $order->amount=$request->input('amount');
   $order->status=0;
   $order->save();


   $order=order::where('status',0)->where('user_id',$user)->first();

    return view('checkout.index',compact('order'));

}



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2uoDU3E
via IFTTT

Aucun commentaire:

Enregistrer un commentaire