mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-10 21:11:05 +03:30
59 lines
1.2 KiB
PHP
59 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App;
|
|
|
|
use Illuminate\Notifications\Notifiable;
|
|
use Illuminate\Contracts\Auth\MustVerifyEmail;
|
|
use Illuminate\Foundation\Auth\User as Authenticatable;
|
|
use Laravel\Passport\HasApiTokens;
|
|
|
|
class User extends Authenticatable
|
|
{
|
|
use Notifiable, HasApiTokens;
|
|
|
|
/**
|
|
* The attributes that are mass assignable.
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $fillable = [
|
|
'name', 'email', 'password','cell_number','status','medical_center_id'
|
|
];
|
|
|
|
/**
|
|
* 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',
|
|
];
|
|
|
|
public function medicalcenter()
|
|
{
|
|
return $this->belongsTo('App\MedicalCenter');
|
|
}
|
|
public function testresults()
|
|
{
|
|
return $this->hasMany('App\TestResult');
|
|
}
|
|
public function testtypes()
|
|
{
|
|
return $this->hasMany('App\TestType');
|
|
}
|
|
|
|
public function findForPassport($username)
|
|
{
|
|
return $this->where('cell_number', $username)->first();
|
|
}
|
|
}
|