dimanche 18 août 2019

validation inputs throw a The GET method is not supported for this route. Supported methods: POST. error

I'm trying to validate input field but, when I use the validation rules it throw a: The GET method is not supported for this route. Supported methods: POST. error.

This is my controller

public function delivery(Request $request)
{
    $request->validate([
        'code' =>'required|numeric|size:4'
    ]);

    return view('frontEnd.orderInfo');
}

This is the route :

Route::post('/delivery','orderController@delivery');

This is the view

<form id="loginform" action="" class="form-horizontal" method="post" role="form" enctype="multipart/form-data">
    @if ($errors->any())
        <div class="alert alert-danger">
            <ul>
                @foreach ($errors->all() as $error)
                    <li></li>
                @endforeach
            </ul>
        </div>
    @endif 
    
       
    <div style="margin-bottom: 25px" class="input-group">
        <span class="input-group-addon"><i class="glyphicon glyphicon-phone"></i></span>
        <input  type="password" class="form-control" name="code" value="" placeholder="enter code.">
    </div>    
    <div style="margin-top:10px" class="form-group">
        <!-- Button -->
        <div class="col-sm-12 controls">
            <input type="submit" class="btn btn-success" value="submit"/>          
        </div>
    </div>  
</form>



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

Aucun commentaire:

Enregistrer un commentaire