all feature
This commit is contained in:
+31
-24
@@ -2,48 +2,55 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
// use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||
use Database\Factories\UserFactory;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
|
||||
class User extends Authenticatable
|
||||
{
|
||||
/** @use HasFactory<UserFactory> */
|
||||
use HasFactory, Notifiable;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var list<string>
|
||||
*/
|
||||
const ROLE_MEMBER = 0;
|
||||
const ROLE_ADMIN = 1;
|
||||
|
||||
const STATUS_INACTIVE = 0;
|
||||
const STATUS_ACTIVE = 1;
|
||||
|
||||
const FLAG_SEND_DISABLED = 0;
|
||||
const FLAG_SEND_ENABLED = 1;
|
||||
|
||||
const FIRST_LOGIN_FALSE = 0;
|
||||
const FIRST_LOGIN_TRUE = 1;
|
||||
|
||||
|
||||
protected $table = 'user';
|
||||
protected $primaryKey = 'msnv';
|
||||
public $incrementing = false;
|
||||
protected $keyType = 'string';
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'email',
|
||||
'password',
|
||||
'msnv',
|
||||
'mail',
|
||||
'pass',
|
||||
'role',
|
||||
'status',
|
||||
'card',
|
||||
'flag_send',
|
||||
'first_login',
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that should be hidden for serialization.
|
||||
*
|
||||
* @var list<string>
|
||||
*/
|
||||
protected $hidden = [
|
||||
'password',
|
||||
'pass',
|
||||
'remember_token',
|
||||
];
|
||||
|
||||
/**
|
||||
* Get the attributes that should be cast.
|
||||
* Get the password for the user.
|
||||
*
|
||||
* @return array<string, string>
|
||||
* @return string
|
||||
*/
|
||||
protected function casts(): array
|
||||
public function getAuthPassword()
|
||||
{
|
||||
return [
|
||||
'email_verified_at' => 'datetime',
|
||||
'password' => 'hashed',
|
||||
];
|
||||
return $this->pass;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user