Use the laravel-admin framework as the backend, hoping to jump to the specified url after the form is submitted successfully. The code is as follows:
$form->saved(function (Form $form) use($pid2) {
// 跳转页面
return redirect('/admin/page/' . $pid2 . '#tab_9');
});
The problem is: the url after the jump becomes '/admin/page/' . $pid2, and the following #tab_9 is deleted, but I need to keep it. How to deal with it?
我想大声告诉你2017-05-16 16:48:52
$redirect = app('redirect');
return $redirect->away($redirect->getUrlGenerator()->to('/admin/page/' . $pid2) . '#tab_9', 302, []);
给我你的怀抱2017-05-16 16:48:52
高洛峰2017-05-16 16:48:52
In the end, I changed the method (using js to read the data in the page and jump to the url). I haven’t tried the above answer, but thank you for your answer.