我刚刚下载了一个名为laravelista/comments的laravel搜索类
文档非常少,所以我并不是真的理解所有的东西。
基本上,当我在‘’localhost:8000/ submit‘中输入我的详细信息并按下登录后,它会将我引导至laravel PrettyPageHandler,并显示以下错误:
Symfony \ Component \ Debug \ Exception \ FatalErrorException (E_UNKNOWN)
Trait 'Laravelista\Comments\Comments\Traits\Comments' not found我已经下载了laravelista/comments并运行了所有命令,如下所示:
php artisan vendor:publish --provider="Laravelista\Comments\Providers\CommentsServiceProvider" --tag=migrations
php artisan migrate
php artisan vendor:publish --provider="Laravelista\Comments\Providers\CommentsServiceProvider" --tag=config
php artisan vendor:publish --provider="Laravelista\Comments\Providers\CommentsServiceProvider" --tag=public --force但我仍然会遇到这个错误
在我的User.php中:
<?php
namespace App;
use Illuminate\Notifications\Notifiable;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Laravelista\Comments\Comments\Traits\Comments;
class User extends Authenticatable
{
use Notifiable;
use Comments;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name', 'email', 'password',
];
/**
* The attributes that should be hidden for arrays.
*
* @var array
*/
protected $hidden = [
'password', 'remember_token',
];
/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = [
'email_verified_at' => 'datetime',
];
}请帮帮忙。
发布于 2019-04-04 16:20:21
我只需要把User.php改成
<?php
namespace App;
use Illuminate\Notifications\Notifiable;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Laravelista\Comments\Commenter;
class User extends Authenticatable
{
use Notifiable,Commenter;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name', 'email', 'password',
];
/**
* The attributes that should be hidden for arrays.
*
* @var array
*/
protected $hidden = [
'password', 'remember_token',
];
/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = [
'email_verified_at' => 'datetime',
];
}我用错了use
https://stackoverflow.com/questions/55510826
复制相似问题