adds roles
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
@@ -23,6 +24,12 @@ final class User extends Authenticatable
|
||||
'name',
|
||||
'email',
|
||||
'password',
|
||||
'azure_id',
|
||||
'photo',
|
||||
'job_title',
|
||||
'department',
|
||||
'phone',
|
||||
'role_id',
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -33,6 +40,7 @@ final class User extends Authenticatable
|
||||
protected $hidden = [
|
||||
'password',
|
||||
'remember_token',
|
||||
'azure_id',
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -45,9 +53,18 @@ protected function casts(): array
|
||||
return [
|
||||
'email_verified_at' => 'datetime',
|
||||
'password' => 'hashed',
|
||||
'role_id' => 'integer',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the role assigned to this user.
|
||||
*/
|
||||
public function role(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Role::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all sessions for this user.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user