changes to management

This commit is contained in:
2026-08-17 10:18:11 +07:00
parent cc615a58ca
commit ff6be8ba1e
29 changed files with 2785 additions and 19 deletions

52
app/Models/Rack.php Normal file
View File

@@ -0,0 +1,52 @@
<?php
namespace App\Models;
use App\Traits\AuditLogTrait;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class Rack extends BaseModel
{
public $timestamps = false;
use HasFactory;
use AuditLogTrait;
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'racks';
protected $primaryKey = 'id';
protected $fillable = [
'equipment_id',
'code',
'name',
'description',
BaseModel::CREATED_AT_FIELD,
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 equipment()
{
return $this->belongsTo(Equipment::class, 'equipment_id', 'id');
}
public function boxes()
{
return $this->hasMany(Box::class, 'rack_id', 'id');
}
}