2022-06-14 01:21:39 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
use Illuminate\Contracts\Auth\MustVerifyEmail;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
|
|
use Illuminate\Foundation\Auth\User as Authenticatable;
|
|
|
|
use Illuminate\Notifications\Notifiable;
|
|
|
|
use Laravel\Sanctum\HasApiTokens;
|
|
|
|
|
|
|
|
class User extends Authenticatable
|
|
|
|
{
|
|
|
|
use HasApiTokens, HasFactory, Notifiable;
|
|
|
|
|
|
|
|
|
|
|
|
protected $table ='users';
|
|
|
|
|
|
|
|
protected $fillable = [
|
|
|
|
'name',
|
2022-07-09 03:09:04 +00:00
|
|
|
'lastname',
|
2022-06-14 01:21:39 +00:00
|
|
|
'email',
|
|
|
|
'password',
|
|
|
|
];
|
|
|
|
|
|
|
|
public $timestamps = false;
|
|
|
|
|
2022-07-09 03:09:04 +00:00
|
|
|
public function estandars(){
|
|
|
|
return $this->hasMany(Estandar::class,'id');
|
|
|
|
}
|
|
|
|
public function plans(){
|
|
|
|
return $this->hasMany(Plan::class,'id');
|
|
|
|
}
|
|
|
|
public function evidencias(){
|
|
|
|
return $this->hasMany(Evidencia::class,'id');
|
|
|
|
}
|
2022-08-18 00:17:24 +00:00
|
|
|
public function providers(){
|
|
|
|
return $this->hasMany(Provider::class,'id_user');
|
|
|
|
}
|
2022-10-20 03:15:33 +00:00
|
|
|
|
|
|
|
public function roles(){
|
|
|
|
return $this->belongsToMany(role::class,'role_user','id_user', 'id_rol');
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-06-14 01:21:39 +00:00
|
|
|
}
|