Removed redundant functions in Account, Optimised User a little more, Moved Ezypay Commands to new Ezypay folder

This commit is contained in:
2024-07-07 10:21:27 +10:00
parent 70e94bf6e6
commit b4f3db04fc
11 changed files with 91 additions and 85 deletions

View File

@@ -7,6 +7,7 @@ use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Support\Collection;
use Illuminate\Database\Eloquent\Collection as DatabaseCollection;
use Illuminate\Support\Facades\Log;
use Laravel\Passport\HasApiTokens;
use Leenooks\Traits\ScopeActive;
use Leenooks\Traits\UserSwitch;
@@ -142,6 +143,18 @@ class User extends Authenticatable implements IDs
/* ATTRIBUTES */
/**
* Logged in user's full name
*
* @return string
* @deprecated use getNameFullAttribute()
*/
public function getFullNameAttribute(): string
{
Log::alert('UMO:! Deprecated function getFullNameAttribute()');
return $this->getNameFullAttribute();
}
/**
* This is an alias method, as it is used by the framework
*
@@ -149,7 +162,7 @@ class User extends Authenticatable implements IDs
*/
public function getNameAttribute(): string
{
return $this->full_name;
return $this->name_full;
}
/**
@@ -157,11 +170,21 @@ class User extends Authenticatable implements IDs
*
* @return string
*/
public function getFullNameAttribute(): string
public function getNameFullAttribute(): string
{
return sprintf('%s %s',$this->firstname,$this->lastname);
}
/**
* Return the name, surname first
*
* @return string
*/
public function getNameSurFirstAttribute()
{
return sprintf('%s, %s',$this->lastname,$this->firstname);
}
/**
* Return a friendly string of this persons role
*
@@ -172,9 +195,15 @@ class User extends Authenticatable implements IDs
return ucfirst($this->role());
}
/**
* Return the name, surname first
* @return string
* @deprecated use getNameSurFirstAttribute()
*/
public function getSurFirstNameAttribute()
{
return sprintf('%s, %s',$this->lastname,$this->firstname);
Log::alert('UMO:! Deprecated function getSurFirstNameAttribute()');
return $this->getNameSurFirstAttribute();
}
/* SCOPES */