39 lines
835 B
PHP
39 lines
835 B
PHP
<?php
|
|||
|
|
|
||
|
|
namespace Modules\Core\Customer\Models;
|
||
|
|
|
||
|
|
use Illuminate\Auth\Authenticatable;
|
||
|
|
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
|
||
|
|
use Illuminate\Foundation\Auth\Access\Authorizable;
|
||
|
|
|
||
|
|
class Customer extends \Lunar\Models\Customer implements AuthenticatableContract
|
||
|
|
{
|
||
|
|
use Authenticatable;
|
||
|
|
use Authorizable;
|
||
|
|
|
||
|
|
protected $casts = [
|
||
|
|
'otp_expires_at' => 'datetime',
|
||
|
|
];
|
||
|
|
|
||
|
|
public function getTitleAttribute(): ?string
|
||
|
|
{
|
||
|
|
return null;
|
||
|
|
}
|
||
|
|
|
||
|
|
public function setTitleAttribute($value): void
|
||
|
|
{
|
||
|
|
// title is not used
|
||
|
|
}
|
||
|
|
|
||
|
|
public function getFullNameAttribute(): string
|
||
|
|
{
|
||
|
|
return trim(
|
||
|
|
preg_replace(
|
||
|
|
"/\s+/",
|
||
|
|
" ",
|
||
|
|
"{$this->first_name} {$this->last_name}",
|
||
|
|
),
|
||
|
|
);
|
||
|
|
}
|
||
|
|
}
|