KTVCentral/app/Models/User.php
allen.yan 7c8c3fe69b DB 滙入
User 介面 只能看資料不能做修改
Role 介面移除
Branch介面 只能看資料不能做修改
Room 介面 可操控 包廂開關台
Sqgger API 可操控API
Room 有操控異動記錄
machine_statuses 需做資料留存需留7 天
20250528
2025-05-28 09:24:03 +08:00

74 lines
2.1 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 Spatie\Permission\Traits\HasRoles;
use App\Traits\LogsModelActivity;
use Spatie\Activitylog\Traits\CausesActivity;
use Laravel\Sanctum\HasApiTokens;
/**
* @OA\Schema(
* schema="User",
* type="object",
* @OA\Property(property="id", type="integer", example=1),
* @OA\Property(property="name", type="string", example="John Doe"),
* @OA\Property(property="email", type="string", example="john@example.com"),
* @OA\Property(property="phone", type="string", example="0900000000"),
* @OA\Property(property="birthday", type="string", format="date-time", example="2025-05-11T16:00:00.000000Z"),
* @OA\Property(property="gender", ref="#/components/schemas/UserGender"),
* @OA\Property(property="status", ref="#/components/schemas/UserStatus"),
* )
*/
class User extends Authenticatable
{
/** @use HasFactory<\Database\Factories\UserFactory> */
use HasApiTokens, HasFactory, Notifiable, HasRoles, LogsModelActivity,CausesActivity;
/**
* The attributes that are mass assignable.
*
* @var list<string>
*/
protected $fillable = [
'name',
'email',
'phone',
'birthday',
'gender',
'status',
'password',
];
/**
* The attributes that should be hidden for serialization.
*
* @var list<string>
*/
protected $hidden = [
'password',
'remember_token',
'api_plain_token',
];
/**
* Get the attributes that should be cast.
*
* @return array<string, string>
*/
protected function casts(): array
{
return [
'email_verified_at' => 'datetime',
'password' => 'hashed',
'birthday' => 'date',
'gender' => \App\Enums\UserGender::class,
'status' => \App\Enums\UserStatus::class,
];
}
}