Return Redirect::to('cv.edit')
->with('id', $id); //<---- id can only be accessed Via Session
Session::get('id');
you used named route
return Redirect::route('cv.edit');
Hello codetrash!
Thank you very much for your answer. Unfortunately, even if i replace my return statement by yours and include the id, it does only show a blank page instead of my form... Do you have any other idea?
Catherine
You can Check /storage/logs for the error....
remove all error inside the log file
run your program again
open the log file again to see which codes going wrong
$diploma = CvDiploma::where('user_uid', '=', $id)->get();
u can use first() to retrieve only one data
$diploma = CvDiploma::where('user_uid', '=', $id)->first();
Thanks, I didn't know the hint with the logfile.... but there is no error! Just a blank page... no error. Makes me wanna cry :-(
But I definitely appreciate your help!!!
If the update method is the controller action you are intending to be called remove static from it. The way you worded it I am not sure if you are using resourceful controllers or are calling this inside another action.
public function update($id)
catherine111 said:
When the form ist submitted, a controller executes this function and finally leads the browser to the first route (see above) again:
public static function update($id) { // store information from personal info form FeUser::where('uid', '=', $id) ->update(array( 'telephone1' => Input::get('telephone1'), 'telephone2' => Input::get('telephone2'), 'telephone3' => Input::get('telephone3') )); // redirect return Redirect::to('cv.edit');
}
Thank you for answering me and sorry for my late answer, I was on holliday! :-D
The controller that calls the update() function looks like this:
Route::put('/personal_info/update', array('as' => 'cv.update', function()
{
$id = Input::get('uid');
FeUserController::update($id);
}));
I recently changed it to this:
Route::put('/personal_info/update', array('as' => 'cv.update', function()
{
$id = Input::get('uid');
FeUserController::update($id);
return Redirect::to('cv');
}));
Now he at least accepts to go back to the root I want him to go to. But that doesn't seem clean to me...
If I do remove "static", I get an error "Non-static method DiplomaController::update() should not be called statically "
You're not really using controllers in the best way. Try
Route::put('personal_info/update/{id}', array('as' => 'cv.update', 'uses' => 'DiplomaController@update'));
In the controller's update method, {id} will be passed as the first argument
public function update($id)
{
// your code
return Redirect::route('cv.edit', array($id));
}
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community