Initial commit
This commit is contained in:
@@ -0,0 +1,88 @@
|
||||
<?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;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'email',
|
||||
'password',
|
||||
'cedula',
|
||||
'estado',
|
||||
'img_perfil',
|
||||
'rol_id'
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that should be hidden for serialization.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $hidden = [
|
||||
'password',
|
||||
'remember_token',
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast.
|
||||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected $casts = [
|
||||
'email_verified_at' => 'datetime',
|
||||
];
|
||||
|
||||
public function rol(){
|
||||
return $this ->belongsTo(Role::class);
|
||||
}
|
||||
|
||||
public function saldo(){
|
||||
return $this ->hasOne(Saldo::class,'usuario_id');
|
||||
}
|
||||
|
||||
public function modificaciones(){
|
||||
return $this ->hasOne(Configuracione::class,'usermodifico_id');
|
||||
}
|
||||
|
||||
public function permisos(){
|
||||
return $this ->hasMany(Permiso::class,'usuario_id');
|
||||
}
|
||||
|
||||
public function preferenciales(){
|
||||
return $this ->hasMany(Preferencial::class,'usuario_id');
|
||||
}
|
||||
|
||||
public function historiales_venta(){
|
||||
return $this ->hasMany(Historiale::class,'vendedor_id');
|
||||
}
|
||||
|
||||
public function historiales_compra(){
|
||||
return $this ->hasMany(Historiale::class,'cliente_id');
|
||||
}
|
||||
|
||||
public function recargas(){
|
||||
return $this ->hasMany(recarga::class,'usuario_id');
|
||||
}
|
||||
|
||||
public function usuario_tarifas(){
|
||||
return $this ->hasMany(Usuario_tarifa::class,'usuario_id');
|
||||
}
|
||||
public function usuario_promos(){
|
||||
return $this ->hasMany(Usuario_promo::class,'usuario_id');
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user