【问题标题】:Trait 'Illuminate\Notifications\HasDatabaseNotifications' not found未找到特征 'Illuminate\Notifications\HasDatabaseNotifications'
【发布时间】:2019-07-12 03:47:50
【问题描述】:

我将 Laravel 站点部署到 cPanel 共享主机,并将我的数据库迁移到主机的数据库。当我尝试通过登录密码进入网站时,错误是:

Symfony \ Component \ Debug \ Exception \ FatalErrorException (E_UNKNOWN)
Trait 'Illuminate\Notifications\HasDatabaseNotifications' not found

/path/to/site/vendor/laravel/framework/src/Illuminate/Notifications/Notifiable.php

<?php

namespace Illuminate\Notifications;

trait Notifiable
{
    use HasDatabaseNotifications, RoutesNotifications;
}

参数

"Trait 'Illuminate\Notifications\HasDatabaseNotifications' not found"

【问题讨论】:

  • 你使用的是什么版本的 laravel?
  • 检查vendor/laravel/framework/src/Illuminate/Notifications/HasDatabaseNotifications.php 是否确实存在于服务器上并且在迁移中没有遗漏是值得的。
  • @MihirBhende laravel 5.6
  • 好的,因为在 5.2 中,这个类不存在。如果课程在场,您能否按照@1000Nettles 的建议进行检查?如果是,您可以尝试运行run composer dump-autoload 吗?
  • @1000Nettles 我没有通过工匠进行任何迁移。我将我的 mysql 数据库从本地主机导出到共享主机。这可能是问题吗?但是在共享主机中没有给出终端。

标签: php mysql laravel migrate


【解决方案1】:

通过评论 HasDatabaseNotifications 解决了我的问题:

<?php

namespace Illuminate\Notifications;

trait Notifiable
{
    use /*HasDatabaseNotifications, */RoutesNotifications;
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-04-14
    • 2018-09-16
    • 2023-03-22
    • 2020-08-16
    • 2017-01-12
    • 1970-01-01
    相关资源
    最近更新 更多