crud freezer
This commit is contained in:
50
app/Models/Equipment.php
Normal file
50
app/Models/Equipment.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
use App\Enums\RecordStatusEnum;
|
||||
use App\Models\Traits\HasLocalizedName;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Support\Facades\Session;
|
||||
use App\Traits\AuditLogTrait;
|
||||
|
||||
class Equipment extends BaseModel
|
||||
{
|
||||
public $timestamps = false;
|
||||
use HasFactory;
|
||||
use HasLocalizedName;
|
||||
use AuditLogTrait;
|
||||
/**
|
||||
* The table associated with the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'equipments';
|
||||
|
||||
protected $appends = ['name'];
|
||||
|
||||
protected $primaryKey = 'id';
|
||||
|
||||
|
||||
|
||||
protected $fillable = [
|
||||
'code', 'room_id', 'name_en','capacity', 'model', 'serial_number', 'organization_id',
|
||||
'equipment_type_concept_id', 'min_temperature', 'max_temperature', 'status', 'installed_date',
|
||||
BaseModel::CREATED_BY_FIELD, BaseModel::UPDATED_AT_FIELD, BaseModel::UPDATED_BY_FIELD,
|
||||
BaseModel::DELETED_AT_FIELD, BaseModel::DELETED_BY_FIELD, BaseModel::RECORD_STATUS_FIELD
|
||||
];
|
||||
|
||||
public static function boot()
|
||||
{
|
||||
parent::boot();
|
||||
}
|
||||
|
||||
public function type(){
|
||||
return $this->belongsTo(Concept::class, 'equipment_type_concept_id', 'id');
|
||||
}
|
||||
|
||||
public function room(){
|
||||
return $this->belongsTo(Room::class, 'room_id', 'id');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user