Deploy Ladill Queue / deploy (push) Successful in 56s
Phases 1–6: tickets, counters, displays, appointments, workflows, rules, analytics, reports, feedback, admin, device API, and Gitea deploy workflow for queue.ladill.com. Co-authored-by: Cursor <cursoragent@cursor.com>
43 lines
1.1 KiB
PHP
43 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Foundation\Auth\User as Authenticatable;
|
|
use Illuminate\Notifications\Notifiable;
|
|
use Laravel\Sanctum\HasApiTokens;
|
|
|
|
/**
|
|
* Thin local mirror of the platform identity (auth.ladill.com owns users).
|
|
* Keyed by the OIDC `sub` (public_id); every CRM record is scoped to it.
|
|
*/
|
|
class User extends Authenticatable
|
|
{
|
|
use HasApiTokens, Notifiable;
|
|
|
|
protected $fillable = ['public_id', 'name', 'email', 'avatar_url', 'password', 'last_app_active_at'];
|
|
|
|
protected $hidden = ['password', 'remember_token'];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'email_verified_at' => 'datetime',
|
|
'last_app_active_at' => 'datetime',
|
|
'password' => 'hashed',
|
|
];
|
|
}
|
|
|
|
/** The owner reference used to scope every CRM record to this account. */
|
|
public function ownerRef(): string
|
|
{
|
|
return (string) $this->public_id;
|
|
}
|
|
|
|
public function avatarUrl(): ?string
|
|
{
|
|
$url = trim((string) $this->avatar_url);
|
|
|
|
return $url !== '' ? $url : null;
|
|
}
|
|
}
|