mardi 9 juillet 2019

Laravel 5.4 trying to save a form but redirecting always to the create controller

I have a very strange issue.

I worked fine but now when i try to post the datas with the submit button the form redirect my always to the create view without going the storeClub method.

here my form :

  {!! Form::open(array('route' => 'store.club', 'method' => 'POST' , 'files' => true )) !!}

                        <div class="row">
                            <div class="form-group col-md-4">
                                <label>Nom * </label>
                                {!! Form::text('lb_nom', null, ['class' => 'form-control', 'placeholder' => 'Nom']) !!}
                            </div>
                            <div class="form-group col-md-5">
                                <label>Prénom *</label>
                                {!! Form::text('lb_prenom', null, ['class' => 'form-control', 'placeholder' => 'Prénom']) !!}
                            </div>
                        </div>

                        <div class="box-footer" data-step="5" data-intro='Une fois tout les éléments renseignés vous pouvez cliquer sur Enregistrer et votre licence sera directement envoyée dans le Panier.'>
                            {!! Form::submit('Enregistrer', ['class' => 'btn btn-info btn-lg center-block']) !!}
                        </div>

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

Here my routing :

  Route::get('/create/club' , 'StructureController@createClub')->name('create.club');
    Route::post('/save/club' , 'StructureController@storeClub')->name('store.club');

Here my create view :

public function createClub(Request $request){

//do something
        return view('structure/createClub' , compact('type_structure' ,'structure_pere'));

    }

here my store method that i can't call when i submit :

public function storeClub(Request $request){

//do something

    }

what my doing wrong ? i have a lot of forms in the application who works fine like that



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire