samedi 26 août 2017

Laravel 5.4 route for input post

Im new in laravel and i am stucked in place where i need to put information in to DB.

I guess i have done something wrong in form action and routes.

my route file

    ---------------------Admin menu creation routes -----------------------------
*/

    Route::resource('menu', 'MenuController');

here is my create menu blade

  @extends('admin.main')

@section('content') 
<div class="container">
    <div class="row">
        <form action = "" method = "POST">

            <fieldset>

                <input type="text" id="menuName" name="menuName" class="input-block-level" placeholder="Menu name">
                <input type="text" id="linkName" name="menuLink" class="input-block-level" placeholder="Menu link ">
                <button type="submit" class="btn btn-success pull-right">Submit</button>
            </fieldset>
        </form>
    </div>
</div>
@endsection  

controller

      public function store(Request $request)
{
    $this->validate($request, [
        'menuName' => 'required',
        'menuLink' => 'required'
    ]);
    return 123;



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire