reconstruction of the project

This commit is contained in:
root
2026-03-08 16:33:24 -04:00
parent 23b7db1107
commit c8de5f7edc
9157 changed files with 77877 additions and 1073823 deletions
+18 -14
View File
@@ -7,13 +7,10 @@ use App\Models\BaseModel;
class InventoryItem extends BaseModel
{
protected $table = 'inventory_items';
protected $primaryKey = 'id';
protected $useSoftDeletes = false;
public $timestamps = true;
const CREATED_AT = 'created_at';
const UPDATED_AT = 'updated_at';
// IMPORTANT: include everything you ever update/insert
// ✅ CI: useTimestamps = true
public $timestamps = true;
protected $fillable = [
'type',
'category_id',
@@ -37,13 +34,20 @@ class InventoryItem extends BaseModel
'updated_at',
];
protected $casts = [
'category_id' => 'integer',
'quantity' => 'integer',
'updated_by' => 'integer',
protected $validationRules = [
'type' => 'required|in_list[classroom,book,office,kitchen]',
'name' => 'required|min_length[2]',
'quantity' => 'permit_empty|integer',
'unit_price' => 'permit_empty|decimal',
'semester' => 'permit_empty|in_list[Spring,Fall]',
'school_year' => 'permit_empty|max_length[16]', // e.g. 2025-2026
'good_qty' => 'integer',
'needs_repair_qty' => 'integer',
'need_replace_qty' => 'integer',
'cannot_find_qty' => 'integer',
];
}
/* Optional relationships */
public function category()
{
return $this->belongsTo(InventoryCategory::class, 'category_id');
}
}