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

56
app/Models/Box.php Normal file
View File

@@ -0,0 +1,56 @@
<?php
namespace App\Models;
use App\Traits\AuditLogTrait;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class Box extends BaseModel
{
public $timestamps = false;
use HasFactory;
use AuditLogTrait;
/**
* The table associated with the model.
*
* Note: the current database schema uses the legacy table name "boxs".
*
* @var string
*/
protected $table = 'boxs';
protected $primaryKey = 'id';
protected $fillable = [
'rack_id',
'code',
'name',
'rows',
'columns',
'capacity',
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 rack()
{
return $this->belongsTo(Rack::class, 'rack_id', 'id');
}
public function positions()
{
return $this->hasMany(Position::class, 'box_id', 'id');
}
}