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

Call to undefined method RealRashid\SweetAlert\Toaster::add() #55

Closed
Shipu opened this issue Oct 29, 2019 · 5 comments
Closed

Call to undefined method RealRashid\SweetAlert\Toaster::add() #55

Shipu opened this issue Oct 29, 2019 · 5 comments

Comments

@Shipu
Copy link

Shipu commented Oct 29, 2019

  • Package Version: 2.0.3
  • Laravel Version: 6.4.1

Description:

Call to undefined method RealRashid\SweetAlert\Toaster::add()

Steps To Reproduce:

always show this 500 error

@realrashid
Copy link
Owner

Hey @Shipu is your project on GitHub then share the repo i will check what's wrong because i just test out with fresh Laravel 6.4 everything working perfectly.

Why not run

composer dump-autoload 

command in your project?

@realrashid
Copy link
Owner

close due to inactivity!

@kashifsindhu
Copy link

@if (alert()->ready())
<script>
swal({
title: "{!! alert()->message() !!}",
text: "{!! alert()->option('text') !!}",
type: "{!! alert()->type() !!}",
@if(alert()->option('timer'))
timer: {!! alert()->option('timer') !!},
showConfirmButton: false,
@endif
});
</script>
@endif

I got this Error .

Error
Call to undefined method RealRashid\SweetAlert\Toaster::ready()

@realrashid
Copy link
Owner

realrashid commented Dec 22, 2021 via email

@MALB1993
Copy link

After adding providers and aliases you need to go through the following steps

first include the sweet alert under the script tag
@include('sweetalert::alert')

publish the Sweet Alert file
php artisan sweetalert:publish

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

4 participants