Saturday, May 12, 2018

MethodNotAllowedHttpException on form submit - development

MethodNotAllowedHttpException on form submit

I have some problem with my form::open with laravel 5.5
i am getting error

Symfony Component HttpKernel Exception
MethodNotAllowedHttpException No message

This is my addressescontroller

public function store(Request $request)
{
    $this->validate($request,[
        'addressline'=>'required',
        'city'=>'required',
        'state'=>'required',
        'zip'=>'required|integer',
        'phone'=>'required|integer',
    ]);

    Auth::user()->address()->create($request->all());

    return redirect()->route('checkout.payment');
}

this is my route

Route::get('payment','CheckoutController@payment')->name('checkout.payment');

.
this is my shiping-info.blade.php

   @extends('layouts.main')

@section('content')
    <br>
<div class="row">
    <div class="small-6 small-centered columns">
        <h3>Shipping Info</h3>

        {!! Form::open(array('action' => 'checkout.payment', 'method' => 'POST')) !!}


   .....

 
    {!! Form::close() !!}

when i submit the button code.. the error like above ..
whats wrong ?



from Laravel Questions and Answers https://laravelquestions.com/laravel/methodnotallowedhttpexception-on-form-submit/
via Lzo Media

No comments:

Post a Comment