我有一个包含用户表的数据库。
此用户表是在我使用laravel / ui之前创建的
这是我的用户模型的代码:
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class users extends Model
{
public function herbs()
{
return $this->hasMany(herbs::class);
}
public function drugs()
{
return $this->hasMany(drugs::class);
}
public function references()
{
return $this->hasMany(references::class);
}
public function targets()
{
return $this->hasMany(targets::class);
}
public function posts()
{
return $this->hasMany(posts::class);
}
public function roles()
{
return $this->belongsTo(roles::class);
}
}
我有另一个使用laravel / ui命令创建的名为“ User.php”的模型:
<?php
namespace App;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
class User extends Authenticatable
{
use Notifiable;
/**
* 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',
];
}
我有点迷茫,我不知道使用哪种型号?
我要合并两个模型吗?
我还有一个由mysel创建的表,我添加了两个字段(Remember_token和密码)
预先感谢您的帮助。