New-OMIS/Modules/Employee/app/Models/Employee.php
2024-04-16 10:54:23 +05:45

25 lines
524 B
PHP

<?php
namespace Modules\Employee\Models;
use App\Models\User;
use Illuminate\Database\Eloquent\Model;
class Employee extends Model
{
protected $table = 'tbl_employees';
protected $primaryKey = 'id';
protected $guarded = [];
protected $appends = ['full_name'];
protected function getFullNameAttribute()
{
return $this->first_name . ' ' . $this->middle_name . ' ' . $this->last_name;
}
public function user()
{
return $this->belongsTo(User::class, 'users_id');
}
}