FilamentF
Filamentβ€’3y ago
Husky110

Posting data from one page to another with a form

Hi - What I wanna do is post data from one custom page to another via POST-Request. Right now I face three issues:
1.) How does the Target-Page has to look like so it's route is only accessable through a post-request? I guess I have to modify the getRoutes()-function to look like this:
return function () {
            Route::post(self::$slug, self::class)
                ->middleware(self::getMiddlewares())
                ->name($slug);
        };

Right?
2.) How do I access said post-data inside the target-page?
3.) How does my submit()-function has to look like? getState and such yes, but is it as simple as return redirect(TargetPage::getUrl(['post-data' => $this->form->getState()])) ?
Edit: Just to clarify - I do not want to do something with a model here. Basically I'm building a multi-step-process with some pages where one step's data is dependent on the last step's values (which is why I don't use Steps or Wizards).
Was this page helpful?