31 lines
618 B
PHP
31 lines
618 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class SubLocation extends Model
|
|
{
|
|
protected $table = 'sub_locations';
|
|
|
|
protected $fillable = [
|
|
'name',
|
|
'status',
|
|
'description',
|
|
'location_id',
|
|
'enhancer_id'
|
|
];
|
|
|
|
public function location(){
|
|
return $this->belongsTo(Location::class, 'location_id', 'id');
|
|
}
|
|
|
|
public function issues(){
|
|
return $this->hasMany(IssueManagement::class, 'sub_location_id', 'id');
|
|
}
|
|
|
|
public function enhancer(){
|
|
return $this->belongsTo(User::class, 'enhancer_id', 'id');
|
|
}
|
|
}
|