From 4b86674ac7997f6d8c5c32dcfbfbe8959f44ae50 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Sun, 9 Jan 2022 11:31:01 +0100 Subject: [PATCH] app/Http/Livewire/Form/ModelForm.php: use redirect()->with() helper instead of session()->flash() --- app/Http/Livewire/Form/ModelForm.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Livewire/Form/ModelForm.php b/app/Http/Livewire/Form/ModelForm.php index 491e235..afa9db8 100644 --- a/app/Http/Livewire/Form/ModelForm.php +++ b/app/Http/Livewire/Form/ModelForm.php @@ -56,8 +56,8 @@ abstract class ModelForm extends Component $this->record->save(); if ($this->isNew()) { - session()->flash('info', "{$this->getModelName()} was successfully created."); - return redirect()->route($this->redirect_route); + return redirect()->route($this->redirect_route) + ->with('info', "{$this->getModelName()} was successfully created."); } $this->info("{$this->getModelName()} was successfully updated.");