95 lines
1.9 KiB
PHP
95 lines
1.9 KiB
PHP
<?php
|
|
|
|
namespace App;
|
|
|
|
use App\Role;
|
|
use App\Models\LinkedSocialAccount;
|
|
use App\Models\Cards;
|
|
use App\Models\Suppliers;
|
|
use App\Models\Postulations;
|
|
use App\Report;
|
|
use App\ReportComment;
|
|
use Laravel\Passport\HasApiTokens;
|
|
use Illuminate\Contracts\Auth\MustVerifyEmail;
|
|
use Illuminate\Notifications\Notifiable;
|
|
use App\Notifications\PasswordReset;
|
|
use Illuminate\Foundation\Auth\User as Authenticatable;
|
|
|
|
class User extends Authenticatable
|
|
{
|
|
use HasApiTokens;
|
|
use Notifiable;
|
|
protected $fillable = [
|
|
'name',
|
|
'email',
|
|
'profile_photo',
|
|
'role_id',
|
|
'social_id',
|
|
'openpay_id',
|
|
'password',
|
|
'phone',
|
|
'openpay_id',
|
|
'phone_verified_at'
|
|
];
|
|
protected $hidden = [
|
|
'password',
|
|
'remember_token',
|
|
];
|
|
|
|
/**
|
|
* Send the password reset notification.
|
|
*
|
|
* @param string $token
|
|
* @return void
|
|
*/
|
|
public function sendPasswordResetNotification($token)
|
|
{
|
|
$this->notify(new PasswordReset($token));
|
|
}
|
|
|
|
public function linkedSocialAccounts()
|
|
{
|
|
return $this->hasMany(LinkedSocialAccount::class);
|
|
}
|
|
|
|
public function cards()
|
|
{
|
|
return $this->hasMany(Cards::class);
|
|
}
|
|
|
|
public function suppliers()
|
|
{
|
|
return $this->hasOne(Suppliers::class);
|
|
}
|
|
|
|
public function postulations()
|
|
{
|
|
return $this->hasMany(Postulations::class);
|
|
}
|
|
|
|
public function currentcontracts()
|
|
{
|
|
return $this->hasMany(CurrentContracts::class);
|
|
}
|
|
|
|
public function finishedcontracts()
|
|
{
|
|
return $this->hasMany(FinishedContracts::class);
|
|
}
|
|
|
|
public function reports()
|
|
{
|
|
return $this->hasMany(Report::class);
|
|
}
|
|
|
|
public function reportcomments()
|
|
{
|
|
return $this->hasMany(ReportComment::class);
|
|
}
|
|
|
|
public function roles()
|
|
{
|
|
return $this->belongsTo('App\Role', 'role_id');
|
|
}
|
|
}
|