3.1 KiB
3.1 KiB
Copilot Instructions for absensi_TA (Laravel Attendance System)
Project Overview
- This is a Laravel-based web application for attendance management and related admin/employee workflows.
- Main features: user management, attendance tracking, leave (cuti) requests, damaged goods (barang rusak) reporting.
- Follows standard Laravel MVC structure:
app/Models,app/Http/Controllers,resources/views,routes/web.php.
Architecture & Data Flow
- Models: Eloquent ORM models in
app/Models(e.g.,Attendance.php,User.php,BarangRusak.php). - Controllers: Business logic in
app/Http/Controllers. Each domain (attendance, user, etc.) has its own controller. - Views: Blade templates in
resources/views/, organized by feature (e.g.,absensi/,admin/,barang-rusak/,cuti/). - Routes: Main routing in
routes/web.php. Console commands inroutes/console.php. - Migrations: Database schema changes in
database/migrations/. Multiple migrations for user table extensions (roles, usernames, profile fields). - Seeders/Factories: Test data in
database/seeders/anddatabase/factories/.
Developer Workflows
- Local Development: Use XAMPP for local server (
public/index.php). - Environment: Configure
.envfor DB and app settings. SQLite is used by default (database/database.sqlite). - Build Assets: Use Vite (
vite.config.js). Runnpm installthennpm run devto build front-end assets. - Testing: PHPUnit config in
phpunit.xml. Run tests withvendor/bin/phpunit. - Database Migrations: Run
php artisan migrateto apply migrations. Usephp artisan db:seedfor seed data. - Debugging: Use Laravel's built-in error pages and logging (
storage/logs/).
Project-Specific Conventions
- User Table: Extended with multiple migrations for roles, usernames, and profile fields. Check migration files for schema evolution.
- Views: Blade templates are grouped by feature. Layouts in
resources/views/layouts/. - Role Management: User roles are managed via DB fields and checked in controllers/views.
- Attendance Logic: Core attendance logic in
Attendance.phpmodel and related controllers. - Damaged Goods: Managed via
BarangRusak.phpmodel andbarang-rusak/views.
Integration Points
- External Packages: Managed via Composer (
composer.json). - Front-End: Uses Vite for asset bundling. JS/CSS in
resources/js/andresources/css/. - Storage: Public and private storage in
storage/app/andpublic/storage.
Key Files & Directories
app/Models/— Eloquent modelsapp/Http/Controllers/— Controllersresources/views/— Blade templatesroutes/web.php— Main routesdatabase/migrations/— DB schema.env— Environment configvite.config.js— Front-end build configphpunit.xml— Test config
Example Commands
- Migrate DB:
php artisan migrate - Seed DB:
php artisan db:seed - Run tests:
vendor/bin/phpunit - Build assets:
npm run dev
If any section is unclear or missing important project-specific details, please provide feedback to improve these instructions.