Tii
Tii
FFilament
Created by Tii on 10/12/2024 in #❓┊help
Preset attributes according to selected tab/previously created record
I added a afterCreate function like this:
protected function afterCreate(): void
{
Session::flash('event', $this->record);
}
protected function afterCreate(): void
{
Session::flash('event', $this->record);
}
After that I could use the session helper function to get my event from the previous creation. That works for the first request after creation like with "create another" but ideally those data would persist with a reload. But only when you click on "create another". If I would switch to Session::put(...) it would be saved for too long, since it would be prefilled even if you abort the creation and come back to it later in that session. Any improvement proposals? I'm happy for every hint.
3 replies