Support the ongoing development of Laravel.io →
posted 10 years ago
Forms
Last updated 2 years ago.
0
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');

Dynamic Layout in Laravel 4

Last updated 2 years ago.
0

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

Last updated 2 years ago.
0

You can Check /storage/logs for the error....

  1. remove all error inside the log file

  2. run your program again

  3. 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();

Last updated 2 years ago.
0

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!!!

Last updated 2 years ago.
0

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');

}

Last updated 2 years ago.
0

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 "

Last updated 2 years ago.
0

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));
}
Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.