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
+41 -3
View File
@@ -2,11 +2,15 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use App\Models\BaseModel;
class InventoryMovement extends Model
class InventoryMovement extends BaseModel
{
protected $table = 'inventory_movements';
// ✅ CI: useTimestamps = true (created_at/updated_at)
public $timestamps = true;
protected $fillable = [
'item_id',
'qty_change',
@@ -22,5 +26,39 @@ class InventoryMovement extends Model
'created_at',
'updated_at',
];
public $timestamps = true;
protected $casts = [
'item_id' => 'integer',
'qty_change' => 'integer',
'performed_by' => 'integer',
'teacher_id' => 'integer',
'student_id' => 'integer',
'class_section_id'=> 'integer',
];
/* Optional relationships */
public function item()
{
return $this->belongsTo(InventoryItem::class, 'item_id');
}
public function performer()
{
return $this->belongsTo(User::class, 'performed_by');
}
public function teacher()
{
return $this->belongsTo(User::class, 'teacher_id');
}
public function student()
{
return $this->belongsTo(Student::class, 'student_id');
}
public function classSection()
{
return $this->belongsTo(ClassSection::class, 'class_section_id');
}
}