mardi 24 mars 2015

passing two parameter in form cant seem to figue out

Basically I have an event ID and User ID i need to pass in the form to store... however when i hit create it comes up with


Route pattern "/roles/{id}/{{id}}" cannot reference variable name "id" more than once.


However if i hit enter in the URL bar it works... so not to sure whats happening here... help would be greatful here the code.



Route file
Route::get('racehistory/{event_id}/store/{user_id}/race/','racehistoryControlle@store');


Form View



{{ Form::open(array('class' => 'form-horizontal', 'method' => 'post', 'action' => array('racehistoryController@store', $user->id, $event->id))) }}


Controller - racehistoryController



public function store($event_id, $user_id)
{
$rules = array(
'start_event' => 'required',
'end_event' => 'required',
'pool_type' => 'required|max:3|min:3',
'name' => 'required|max:35|min:3',
'location' => 'required|max:35|min:3',
);

$validator = Validator::make(Input::all(), $rules);

if ($validator->fails()) {
return 'form works';
}
}

Aucun commentaire:

Enregistrer un commentaire