I am having difficulties to get that working properly, there's probably an error with the way i am trying to pass the id variable to the method. I am using Laravel.
My view contains this form to handle the function and pass the id:
{{ Form::open(array('method' => 'GET', 'url' => array('uploads/edit', $upload->id))) }}
{{ Form::submit('Edit', array('class' => 'btn btn-info')) }}
{{ Form::close() }}
Controller:
public function getEdit($id)
{
$upload = $this->upload->find($id);
if (is_null($upload))
{
return Redirect::to('uploads/alluploads');
}
$layout->layout->content = View::make('uploads.edit', compact('upload'));
}
Error:
ErrorException
Creating default object from empty value