2026-01-19 06:37:37 +07:00
|
|
|
<?php
|
|
|
|
|
namespace App\Models\Master;
|
|
|
|
|
|
|
|
|
|
use App\Models\BaseModel;
|
|
|
|
|
|
|
|
|
|
class MasterDeptsModel extends BaseModel {
|
|
|
|
|
protected $table = 'master_depts';
|
|
|
|
|
protected $primaryKey = 'dept_id';
|
|
|
|
|
protected $allowedFields = [
|
docs: add comprehensive documentation and refactor API structure
This commit introduces a complete documentation suite, refactors the API layer for
better consistency, and updates the database schema and seeding logic.
Key Changes:
- Documentation:
- Added `CLAUDE.md` with development guidelines and architecture overview.
- Created `docs/` directory with detailed guides for architecture, development,
and source tree analysis.
- Database & Migrations:
- Implemented `RenameMasterColumns` migration to standardize column naming
(e.g., `name` -> `dept_name`, `name` -> `control_name`).
- Added `CmodQcSeeder` to populate the system with realistic sample data
for depts, controls, tests, and results.
- Backend API:
- Created `DashboardApiController` with `getRecent()` for dashboard stats.
- Created `ReportApiController` for managed reporting access.
- Updated `app/Config/Routes.php` with new API groupings and documentation routes.
- Frontend & Views:
- Refactored master data views (`dept`, `test`, `control`) to use Alpine.js
and the updated API structure.
- Modernized `dashboard.php` and `main_layout.php` with improved UI/UX.
- Infrastructure:
- Updated `.gitignore` to exclude development-specific artifacts (`_bmad/`, `.claude/`).
2026-01-20 14:44:46 +07:00
|
|
|
'dept_name',
|
2026-01-19 06:37:37 +07:00
|
|
|
'created_at',
|
|
|
|
|
'updated_at',
|
|
|
|
|
'deleted_at'
|
|
|
|
|
];
|
|
|
|
|
protected $useTimestamps = true;
|
|
|
|
|
protected $useSoftDeletes = true;
|
|
|
|
|
|
|
|
|
|
public function search($keyword = null) {
|
|
|
|
|
if ($keyword) {
|
|
|
|
|
return $this->groupStart()
|
docs: add comprehensive documentation and refactor API structure
This commit introduces a complete documentation suite, refactors the API layer for
better consistency, and updates the database schema and seeding logic.
Key Changes:
- Documentation:
- Added `CLAUDE.md` with development guidelines and architecture overview.
- Created `docs/` directory with detailed guides for architecture, development,
and source tree analysis.
- Database & Migrations:
- Implemented `RenameMasterColumns` migration to standardize column naming
(e.g., `name` -> `dept_name`, `name` -> `control_name`).
- Added `CmodQcSeeder` to populate the system with realistic sample data
for depts, controls, tests, and results.
- Backend API:
- Created `DashboardApiController` with `getRecent()` for dashboard stats.
- Created `ReportApiController` for managed reporting access.
- Updated `app/Config/Routes.php` with new API groupings and documentation routes.
- Frontend & Views:
- Refactored master data views (`dept`, `test`, `control`) to use Alpine.js
and the updated API structure.
- Modernized `dashboard.php` and `main_layout.php` with improved UI/UX.
- Infrastructure:
- Updated `.gitignore` to exclude development-specific artifacts (`_bmad/`, `.claude/`).
2026-01-20 14:44:46 +07:00
|
|
|
->like('dept_name', $keyword)
|
2026-01-19 06:37:37 +07:00
|
|
|
->groupEnd()
|
|
|
|
|
->findAll();
|
|
|
|
|
}
|
|
|
|
|
return $this->findAll();
|
|
|
|
|
}
|
|
|
|
|
}
|