laravel-splade icon indicating copy to clipboard operation
laravel-splade copied to clipboard

<x-splade-form stay> popups Toast twice

Open dusp2k opened this issue 10 months ago • 1 comments

  • 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();
}

dusp2k avatar Sep 01 '23 10:09 dusp2k

Possibly linked to #443

P-James avatar Sep 02 '23 10:09 P-James