laravel-splade
laravel-splade copied to clipboard
<x-splade-form stay> popups Toast twice
- Laravel Version: 10
- PHP Version: 8.2
- Splade JS Version (npm): 1.4.16
- Splade PHP Version (composer): 1.4.15.1
- Dev environment (OS, Sail/Valet/etc): Windows
Using a <x-splade-form>
with the stay
attribute and a Toast
in the controller will show the toast twice after saving again. So it will popup 2 toasts at once each time you save.
If you hit F5 after save it will also popup the toast one more time.
Blade
<x-splade-form method="PUT" action="{{ route('model.update', $model) }}" stay>
...
<x-splade-submit label="Save" />
</x-splade-form>
ModelController
public function update(Request $request, Model $model)
{
// save model logic
Toast::success('Model saved');
return back();
}
Possibly linked to #443