Merge remote-tracking branch 'origin/staging' into origin/production
This commit is contained in:
35
app/Models/OLDLMS/DoctorOnline.php
Executable file
35
app/Models/OLDLMS/DoctorOnline.php
Executable file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\OLDLMS;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class DoctorOnline extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
const CREATED_AT = 'dCreateOn';
|
||||
const UPDATED_AT = 'dUpdateOn';
|
||||
const DELETED_AT = 'dDeleteOn';
|
||||
|
||||
protected $connection = 'oldlms';
|
||||
protected $table = 'tx_user_online';
|
||||
|
||||
// Define a belongsTo relationship with the User model
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'nIDUser');
|
||||
}
|
||||
|
||||
// Include additional fields in the model's JSON form
|
||||
protected $appends = [
|
||||
'user_first_name', // Include the attribute for user's first name
|
||||
];
|
||||
|
||||
// Define an accessor to get the first name of the related user
|
||||
public function getUserFirstNameAttribute()
|
||||
{
|
||||
return $this->user ? $this->user->sFirstName : null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user