birzha-legalizasia/app/Models/Resolutionbasis.php

70 lines
2.0 KiB
PHP
Raw Normal View History

2022-11-19 11:28:38 +00:00
<?php
namespace App\Models;
use Backpack\CRUD\app\Models\Traits\CrudTrait;
use Illuminate\Database\Eloquent\Model;
class Resolutionbasis extends Model
{
use CrudTrait;
/*
|--------------------------------------------------------------------------
| GLOBAL VARIABLES
|--------------------------------------------------------------------------
*/
protected $table = 'resolutionbasis';
// protected $primaryKey = 'id';
// public $timestamps = false;
protected $guarded = ['id'];
protected $fillable = [
'contract_id', 'workflow_id', 'department_id', 'resolution_id', 'resolutionbasis'
];
2022-11-21 10:59:56 +00:00
protected $with = ['department','resolution'];
2022-11-19 11:28:38 +00:00
// protected $hidden = [];
// protected $dates = [];
/*
|--------------------------------------------------------------------------
| FUNCTIONS
|--------------------------------------------------------------------------
*/
/*
|--------------------------------------------------------------------------
| RELATIONS
|--------------------------------------------------------------------------
*/
public function department(){
return $this->belongsTo(Department::class, 'department_id');
}
public function resolution(){
return $this->belongsTo(Resolution::class, 'resolution_id');
}
2022-11-22 10:29:40 +00:00
public function contract(){
2022-11-22 10:54:10 +00:00
return $this->belongsTo(Contract::class, 'contract_id', 'foreign_ID');
2022-11-22 10:29:40 +00:00
}
2022-11-19 11:28:38 +00:00
/*
|--------------------------------------------------------------------------
| SCOPES
|--------------------------------------------------------------------------
*/
/*
|--------------------------------------------------------------------------
| ACCESSORS
|--------------------------------------------------------------------------
*/
/*
|--------------------------------------------------------------------------
| MUTATORS
|--------------------------------------------------------------------------
*/
}