Files
ERP-upgrade/app/Models/OfficeLocation.php
2026-08-26 23:03:11 +00:00

33 lines
791 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class OfficeLocation extends Model
{
protected $guarded = array('id');
protected $table = 'office_locations';
public function created_by_info(){
return $this->hasOne('App\Models\StaffMember', 'id', 'user_id');
}
public function country_manager_info(){
// return $this->hasOne('App\Models\StaffMember', 'id', 'country_manager_id');
return $this->hasOne('App\Models\StaffMember', 'id', 'country_manager_id');
}
public function manager()
{
return $this->belongsTo(StaffMember::class, 'country_manager_id');
}
public function documents()
{
return $this->hasMany(OfficeLocationDocument::class, 'office_location_id');
}
}