Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 未定义的属性:App\Notifications\NewUserNotification::$id_Php_Laravel_Notifications_Laravel 8 - Fatal编程技术网

Php 未定义的属性:App\Notifications\NewUserNotification::$id

Php 未定义的属性:App\Notifications\NewUserNotification::$id,php,laravel,notifications,laravel-8,Php,Laravel,Notifications,Laravel 8,当数据存储在数据库中,但我想创建通知时,显示通知。发生此错误 use Queueable; public $user; /** * Create a new notification instance. * * @return void */ public function __construct($user) { $this->user = $user; } public fu

当数据存储在数据库中,但我想创建通知时,显示通知。发生此错误

  use Queueable;

    public $user;

   /**
     * Create a new notification instance.
     *
     * @return void
     */
    public function __construct($user)
    {
        $this->user = $user;
    }

    public function via($notifiable)
    {
        return ['database'];
    }

    public function toDatabase($notifiable)
    {
        return [
            'name' => $this->user->name,
            'email' => $this->user->email,
        ];
    }

请共享整个类和使用它的代码。错误还应该告诉您发生错误的确切位置。请在此处共享代码位置。您解决问题了吗?