【问题标题】:Sweet alert error. Undefined type 'RealRashid\SweetAlert\Facades\Alert'甜蜜的警报错误。未定义类型“RealRashid\SweetAlert\Facades\Alert”
【发布时间】:2021-11-24 02:29:43
【问题描述】:

我不知道如何解决这个错误。

config/app.php 我把这个放在提供者中:

RealRashid\SweetAlert\SweetAlertServiceProvider::class,

还有这个别名:

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

在我的布局中我使用这个:

@include('sweetalert::alert')

在控制器中我放了这个:

use RealRashid\SweetAlert\Facades\Alert;

我输入了终端 composer dump-autoload 但仍然无法正常工作。

有什么建议吗?

【问题讨论】:

    标签: laravel sweetalert


    【解决方案1】:

    您是否正确配置了软件包?我认为您缺少发布包资产的步骤。

    运行以下命令发布包资产。

    php artisan sweetalert:publish

    【讨论】:

    • 行得通!非常感谢!
    • 很高兴为您工作!你可以接受答案。
    猜你喜欢
    • 1970-01-01
    • 2023-03-20
    • 2021-09-02
    • 2018-07-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多