Cleanup usage of Leenooks\Carbon, change ServiceType to be consistent with Products/ Suppliers/
This commit is contained in:
@@ -14,6 +14,7 @@ use Laravel\Passport\HasApiTokens;
|
||||
use Leenooks\Traits\ScopeActive;
|
||||
use Leenooks\Traits\UserSwitch;
|
||||
|
||||
use App\Interfaces\IDs;
|
||||
use App\Notifications\ResetPassword as ResetPasswordNotification;
|
||||
use App\Traits\{QueryCacheableConfig,SiteID};
|
||||
|
||||
@@ -23,7 +24,7 @@ use App\Traits\{QueryCacheableConfig,SiteID};
|
||||
* Attributes for users:
|
||||
* + role : User's role
|
||||
*/
|
||||
class User extends Authenticatable
|
||||
class User extends Authenticatable implements IDs
|
||||
{
|
||||
use HasFactory,HasApiTokens,Notifiable,UserSwitch,QueryCacheableConfig,SiteID,ScopeActive;
|
||||
|
||||
@@ -79,6 +80,18 @@ class User extends Authenticatable
|
||||
$this->notify((new ResetPasswordNotification($token))->onQueue('high'));
|
||||
}
|
||||
|
||||
/* INTERFACES */
|
||||
|
||||
public function getLIDAttribute(): string
|
||||
{
|
||||
return sprintf('#%04s',$this->id);
|
||||
}
|
||||
|
||||
public function getSIDAttribute(): string
|
||||
{
|
||||
return sprintf('%02s-%s',$this->site_id,$this->getLIDAttribute());
|
||||
}
|
||||
|
||||
/* RELATIONS */
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user