<?php

namespace App\Models;

use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Illuminate\Support\Facades\Hash;

class User extends Authenticatable
{
    use Notifiable;

    protected $hidden = [
        'password', 'remember_token', 'created_at', 'updated_at', 'social_id',
    ];

    public function setPasswordAttribute($password)
    {
        $this->attributes['password'] = Hash::make($password);
    }
    public function AauthAcessToken()
    {
        return $this->hasMany('\App\OauthAccessToken');
    }

    public function role()
    {
        return $this->belongsTo(UserRoleMaster::class, 'role_id');
    }
        public function ref_user()
    {
        return $this->belongsTo(User::class, 'ref_employee_id');
    }

}
