58 lines
1.3 KiB
PHP
58 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Models\User;
|
|
|
|
use Illuminate\Database\Eloquent\Concerns\HasUuids;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
use Illuminate\Foundation\Auth\User as Authenticatable;
|
|
use Laravel\Sanctum\HasApiTokens;
|
|
use Spatie\Permission\Traits\HasRoles;
|
|
|
|
/**
|
|
* @property string $id
|
|
* @property string $login
|
|
* @property string $password
|
|
* @property bool $is_active
|
|
* @property \Carbon\Carbon $created_at
|
|
* @property \Carbon\Carbon $updated_at
|
|
* @property \Carbon\Carbon|null $deleted_at
|
|
* @property \Illuminate\Database\Eloquent\Collection<int,\Spatie\Permission\Models\Role> $roles
|
|
* @property \Illuminate\Database\Eloquent\Collection<int,\Spatie\Permission\Models\Permission> $permissions
|
|
*
|
|
* @method ?string getKey()
|
|
*
|
|
* @method static \App\Models\User\User findOrFail(string $id)
|
|
*/
|
|
class User extends Authenticatable
|
|
{
|
|
use HasApiTokens, HasUuids, HasRoles, SoftDeletes;
|
|
|
|
/**
|
|
* @var array<int,string>
|
|
*/
|
|
protected $fillable = [
|
|
'login',
|
|
'password',
|
|
'is_active',
|
|
];
|
|
|
|
/**
|
|
* @var array<int,string>
|
|
*/
|
|
protected $hidden = [
|
|
'password',
|
|
'laravel_through_key',
|
|
];
|
|
|
|
/**
|
|
* @return array<string,string>
|
|
*/
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'is_active' => 'boolean',
|
|
'password' => 'hashed',
|
|
];
|
|
}
|
|
}
|