formslaravel-4paginationhttp-redirectresponse.redirect

After update some info, return to specific paginated page - Laravel 4


I have this case:

A page in laravel 4 with paginate (10 items per page), and for instance, if I'm on page 2, I want to edit some item. I click in the item and I go to the specific form to update. After update, i want to redirect the application to the specific paginated page that I was on before, i.e. page 2. I tried to use URL::Previous(); but, if for instance, my validation of the form fire up, the previous page will be the page of the form, and not the paginated page, and then i will be stuck :/

Any ideas? (Sorry for my english)


Solution

  • Maybe you could store the page number in the session and then use it when you want to redirect.

    $url = 'url?page=' . Session::get('page_number');
    return Redirect::to($url);
    

    This is probably not the best way to do it but it should work.