add projet
This commit is contained in:
Executable
+49
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
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
|
||||
protected $fillable = [
|
||||
'type',
|
||||
'category_id',
|
||||
'name',
|
||||
'description',
|
||||
'quantity',
|
||||
'good_qty',
|
||||
'needs_repair_qty',
|
||||
'need_replace_qty',
|
||||
'cannot_find_qty',
|
||||
'unit',
|
||||
'condition',
|
||||
'isbn',
|
||||
'edition',
|
||||
'sku',
|
||||
'notes',
|
||||
'semester',
|
||||
'school_year',
|
||||
'updated_by',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
|
||||
|
||||
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
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user