Add Additional Information
This commit is contained in:
@@ -50,15 +50,13 @@ class Appointment extends Model
|
||||
'dUpdateOn',
|
||||
'dDeleteOn',
|
||||
];
|
||||
|
||||
|
||||
|
||||
|
||||
protected $appends = [
|
||||
'status_name',
|
||||
'payment_method'
|
||||
];
|
||||
|
||||
protected function StatusName(): Attribute
|
||||
protected function statusName(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: function ($value) {
|
||||
@@ -67,7 +65,7 @@ class Appointment extends Model
|
||||
);
|
||||
}
|
||||
|
||||
protected function PaymentMethod(): Attribute
|
||||
protected function paymentMethod(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: function ($value) {
|
||||
|
||||
@@ -31,7 +31,7 @@ class Livechat extends Model
|
||||
'status_name',
|
||||
];
|
||||
|
||||
protected function StatusName(): Attribute
|
||||
protected function statusName(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: function ($value) {
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Models\OLDLMS;
|
||||
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
@@ -17,4 +18,25 @@ class User extends Model
|
||||
protected $connection = 'oldlms';
|
||||
|
||||
protected $table = 'tm_users';
|
||||
|
||||
protected $appends = [
|
||||
'full_name',
|
||||
];
|
||||
|
||||
protected function fullName(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: function ($value) {
|
||||
$names = [];
|
||||
if (!empty($this->sFirstName)) {
|
||||
array_push($names, $this->sFirstName);
|
||||
}
|
||||
if (!empty($this->sLastName)) {
|
||||
array_push($names, $this->sLastName);
|
||||
}
|
||||
|
||||
return implode(' ', $names);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user