abschlussprojekt-device-man.../device-app/app/Models/User.php
2023-03-29 22:32:49 +02:00

70 lines
1.5 KiB
PHP

<?php
namespace App\Models;
// use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Laravel\Sanctum\HasApiTokens;
class User extends Authenticatable
{
use HasApiTokens, HasFactory, Notifiable;
/**
* The table associated with the model.
* @var string
*/
protected $table = 'users';
/**
* The primary key associated with the users table.
* @var string
*/
protected $primaryKey = 'rz_username';
/**
* The attributes that are mass assignable.
*
* @var array<int, string>
*/
protected $fillable = [
'rz_username',
'full_name',
'organisation_unit',
'has_admin_privileges',
'hashed_password'
];
//ID is not auto-incrementing.
public $incrementing = false;
//Timestamps are disabled.
public $timestamps = false;
/**
* The attributes that should be hidden for serialization.
*
* @var array<int, string>
*/
protected $hidden = [
'hashed_password',
//'remember_token',
];
/**
* The attributes that should be cast.
*
* @var array<string, string>
*/
//protected $casts = [
// 'email_verified_at' => 'datetime',
//];
//override variable 'password'
public function getAuthPassword()
{
return $this->hashed_password;
}
}