49 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			49 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| 
 | |
| namespace App;
 | |
| 
 | |
| use Illuminate\Auth\Authenticatable;
 | |
| use Illuminate\Auth\Passwords\CanResetPassword;
 | |
| use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
 | |
| use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
 | |
| use Illuminate\Database\Eloquent\Model;
 | |
| 
 | |
| class User extends Model implements AuthenticatableContract, CanResetPasswordContract
 | |
| {
 | |
|     use Authenticatable,
 | |
|         CanResetPassword;
 | |
| 
 | |
|     /**
 | |
|      * The database table used by the model.
 | |
|      *
 | |
|      * @var string
 | |
|      */
 | |
|     protected $table = 'users';
 | |
| 
 | |
|     /**
 | |
|      * The attributes that are mass assignable.
 | |
|      *
 | |
|      * @var array
 | |
|      */
 | |
|     protected $fillable = ['user_name', 'email', 'password', 'active', 'first_name', 'last_name', 'ban', 'ext', 'mobile', 'profile_pic',
 | |
|         'phone_number', 'company', 'agent_sign', 'account_type', 'account_status',
 | |
|         'assign_group', 'primary_dpt', 'agent_tzone', 'daylight_save', 'limit_access',
 | |
|         'directory_listing', 'vacation_mode', 'role', 'internal_note', ];
 | |
| 
 | |
|     /**
 | |
|      * The attributes excluded from the model's JSON form.
 | |
|      *
 | |
|      * @var array
 | |
|      */
 | |
|     protected $hidden = ['password', 'remember_token'];
 | |
| 
 | |
|     public function getProfilePicAttribute($value)
 | |
|     {
 | |
|         if (!$value) {
 | |
|             return \Gravatar::src($this->attributes['email']);
 | |
|         } else {
 | |
|             return asset('lb-faveo/media/profilepic/'.$value);
 | |
|         }
 | |
|     }
 | |
| }
 | 
