Home > Enterprise >  Sweet alert error. Undefined type 'RealRashid\SweetAlert\Facades\Alert'
Sweet alert error. Undefined type 'RealRashid\SweetAlert\Facades\Alert'

Time:11-25

I have no clue to solve this error.

In config/app.php I put this in providers:

RealRashid\SweetAlert\SweetAlertServiceProvider::class,

and this in aliases:

'Alert' => RealRashid\SweetAlert\Facades\Alert::class,

In my layout I use this:

@include('sweetalert::alert')

and in the controller I put this:

use RealRashid\SweetAlert\Facades\Alert;

I put in the terminal composer dump-autoload but still not working.

Any advice?

CodePudding user response:

Have you configured package correctly? I think you are missing publishing package assets step.

Run the below command to publish the package assets.

php artisan sweetalert:publish

  • Related