TIDE/backend/app/User/UserModel.php
Yisroel Baum 298b8634ec
extend User entity with displayname and email confirmation
Add display_name (unique) and email_confirmed_at columns plus
matching getters, DTO fields, repo methods (findByDisplayName,
update), and migration. Existing auth tests updated to construct
User with the new params.
2026-05-06 22:03:19 +03:00

46 lines
1.2 KiB
PHP

<?php
namespace App\User;
use DateTimeImmutable;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
/**
* @property int $id
* @property string $email
* @property string $display_name
* @property string $password_hash
* @property bool $is_admin
* @property ?DateTimeImmutable $email_confirmed_at
*
* @method static Builder<static>|UserModel newModelQuery()
* @method static Builder<static>|UserModel newQuery()
* @method static Builder<static>|UserModel query()
* @method static Builder<static>|UserModel whereId($value)
* @method static Builder<static>|UserModel whereEmail($value)
* @method static Builder<static>|UserModel whereDisplayName($value)
* @method static Builder<static>|UserModel whereIsAdmin($value)
* @method static Builder<static>|UserModel whereEmailConfirmedAt($value)
*
* @mixin \Eloquent
*/
class UserModel extends Model
{
protected $table = 'users';
public $timestamps = false;
protected $fillable = [
'email',
'display_name',
'password_hash',
'is_admin',
'email_confirmed_at',
];
protected $casts = [
'is_admin' => 'boolean',
'email_confirmed_at' => 'immutable_datetime',
];
}