Laravel по-русски

Русское сообщество разработки на PHP-фреймворке Laravel.

Ты не вошёл. Вход тут.

#1 21.09.2015 17:57:41

Перенаправление.

Всем привет.
Есть страница форма с фильтрами и таблица с результатами, в таблице есть колонка при нажатии которой обновляется поле в бд, после этого в контролере делаю Redirect::back(), но без примененных фильтров. В Форме входят только поля для фильтров. Как сделать redirect к тому состоянии с фильтрами?

Не в сети

#2 25.09.2015 09:59:17

Re: Перенаправление.

Фильтры как реализованы? Через JavaScript? Или через GET запрос, типа такого

site.ru/catalog?sex=male&age=40&country=russia

Изменено Afatar (25.09.2015 09:59:39)

Не в сети

#3 Вчера 12:34:44

Re: Перенаправление.

To redirect back to the table with applied filters after updating a database field, you need to preserve the filter state. The best approach is to store the filter values in the session before the initial redirect after filtering. Then, in the EZPassPA website controller handling the database update, redirect back to the table route and pass the stored filter values as input using `withInput()`. Finally, in the controller displaying the table, retrieve these old input values and re-apply the filters to your data query. Alternatively, you can manually construct a redirect URL with the filter parameters as query strings. Using the session is generally simpler for managing more complex filter states.

Не в сети

Подвал раздела