Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<x-splade-form stay> popups Toast twice #513

Open
dusp2k opened this issue Sep 1, 2023 · 1 comment
Open

<x-splade-form stay> popups Toast twice #513

dusp2k opened this issue Sep 1, 2023 · 1 comment

Comments

@dusp2k
Copy link

dusp2k commented Sep 1, 2023

  • 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();
}
@P-James
Copy link

P-James commented Sep 2, 2023

Possibly linked to #443

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants