Redirects

I want to Redirect from a page to another page,..page is get redirecting i need to send data with it.. Action::make('pay_fees') ->action(function (array $data, $record): void { Redirect::to('app/student-reg-fee-reciept')->with(['student' => $record]); }) the data in another page showing null public function mount(Request $request) { dd($request->get('student')); $this->record = Student::query()->find($request->get('student')); }...how to get data in mount
4 Replies
Dennis Koch
Dennis Koch2y ago
Check the Laravel docs. ->with() stores in the session and doesn't pass params via request query.
Roshan_k
Roshan_kOP2y ago
any alternative for that to pass parameter..
Dennis Koch
Dennis Koch2y ago
Why an alternative?
LeandroFerreira
use named routes https://laravel.com/docs/10.x/routing#named-routes
Action::make('pay_fees')
->url(fn () => route('route-name', ['student' => $this->record]))
Action::make('pay_fees')
->url(fn () => route('route-name', ['student' => $this->record]))
Laravel - The PHP Framework For Web Artisans
Laravel is a PHP web application framework with expressive, elegant syntax. We’ve already laid the foundation — freeing you to create without sweating the small things.
Want results from more Discord servers?
Add your server