Cleanup usage of Leenooks\Carbon, change ServiceType to be consistent with Products/ Suppliers/

This commit is contained in:
Deon George
2022-04-22 11:47:46 +10:00
parent 8ed9e38290
commit a16277d9bb
19 changed files with 65 additions and 64 deletions

View File

@@ -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 */
/**