A production-oriented Complaint Management System built with Laravel 12, Sanctum, and Vue 3 SPA architecture.
This project provides:
- π€ A user portal for submitting and tracking complaints
- π οΈ An admin portal for managing complaints, categories, users, settings, and audit history
- π A JSON API backend for current SPA usage and future mobile integration
- π± Responsive Vue-based screens with minimal Blade usage only for the SPA mount point
- PHP 8.2
- Laravel 12
- Laravel Sanctum
- Laravel Boost
- Vue 3
- Vue Router
- Pinia
- Tailwind CSS 4
- MySQL
- Vite
- PHPUnit 11
The system is designed to manage the full lifecycle of complaints raised by end users.
Users can:
- π Register and log in
- π¨ Submit complaints with category, description, and attachments
- π View complaint status and public responses
- βοΈ Edit or withdraw complaints before admin action
- π Manage their profile and password
- π Search and filter their complaints
Administrators can:
- π Access a separate admin portal
- π View dashboard metrics and complaint trends
- π§ Search, filter, assign, and update complaints
- π¬ Add internal notes and public responses
- ποΈ Manage complaint categories
- π₯ Manage users and trigger password reset links
- βοΈ Manage system settings
- π Review audit logs
- Registration and login
- Email verification flow
- Complaint dashboard with recent complaints and status counts
- Complaint submission form with attachment upload
- Complaint detail page with public response history
- Complaint edit and withdraw actions
- Profile update and password change
- Search and filter by status, category, and date
- Staff-only routing and access control
- Dashboard with complaint statistics
- Complaint management with assignment and status transitions
- Public response and internal note support
- Category CRUD with linked-complaint protection
- User listing, filtering, role/status updates, and reset-password action
- Settings management
- Audit logging
pendingin_progressresolvedrejected
- Service
- Product
- Feedback
- Other
Laravel serves JSON API endpoints only. Authentication is handled through Sanctum session-based SPA auth.
Important API areas:
api/auth/*api/complaints/*api/profile/*api/admin/*
Vue SPA is mounted from a minimal Blade view.
Main frontend areas:
resources/js/pages/authresources/js/pages/userresources/js/pages/adminresources/js/routerresources/js/stores
After running migrations and seeders, these accounts are available:
- Email:
admin@example.com - Password:
password - Role:
admin
- Email:
test@example.com - Password:
password - Role:
user
composer install
npm installCopy .env.example to .env if needed, then configure:
APP_URLDB_*MAIL_*QUEUE_CONNECTION
php artisan key:generatephp artisan migrate --force
php artisan db:seed --forcenpm run buildFor local development:
composer run devThis starts:
- Laravel server
- Queue listener
- Vite dev server
If you prefer manual startup:
php artisan serve
php artisan queue:listen --tries=1 --timeout=0
npm run devphp artisan migrate --force
php artisan db:seed --force
php artisan route:list
php artisan config:show mail
php artisan test --compact
vendor/bin/pint --dirty --format agent
npm run buildPOST /api/auth/registerPOST /api/auth/loginPOST /api/auth/logoutPOST /api/auth/forgot-passwordPOST /api/auth/reset-passwordGET /api/auth/userGET /api/auth/email/statusPOST /api/auth/email/verification-notification
GET /api/dashboardGET /api/categoriesGET /api/complaintsPOST /api/complaintsGET /api/complaints/{complaint}PUT /api/complaints/{complaint}DELETE /api/complaints/{complaint}GET /api/profilePATCH /api/profilePUT /api/profile/password
GET /api/admin/dashboardGET /api/admin/complaintsGET /api/admin/complaints/{complaint}PATCH /api/admin/complaints/{complaint}GET /api/admin/categoriesPOST /api/admin/categoriesPUT /api/admin/categories/{category}DELETE /api/admin/categories/{category}GET /api/admin/settingsPUT /api/admin/settingsGET /api/admin/usersPATCH /api/admin/users/{user}POST /api/admin/users/{user}/reset-password
Complaint attachments are stored on the local disk under the Laravel storage path.
For public storage linking if needed:
php artisan storage:linkThe application supports:
- Verification emails
- Password reset emails
- Complaint status update emails
If email is not being received, check SMTP connectivity from the server machine, not just .env values.
This project already surfaces mail errors in API responses and logs them to:
storage/logs/laravel.log
A common failure case is outbound SMTP being blocked by:
- Windows firewall
- antivirus/security software
- hosting/network restrictions
- blocked Mailtrap SMTP ports
If Mailtrap credentials are correct but mail still does not send, verify that the server can open outbound connections to Mailtrap SMTP.
The SPA reset-password flow is supported through:
- named route
password.reset - SPA page
/reset-password/{token} - API endpoint
POST /api/auth/reset-password
Focused test coverage exists for:
- auth flows
- complaint flows
- admin complaint actions
- admin category actions
- admin user actions
Run all tests:
php artisan test --compact- The app uses Sanctum session authentication for the SPA.
- The verify-email screen includes a sign-out option to avoid being trapped in the verification flow.
- Admin user listing, complaint listing, category management, and complaint response flows have been aligned to a consistent API response shape.
- Password reset emails require the named
password.resetroute, which is already configured.
app/Http/Controllers- API and auth controllersapp/Http/Requests- validation request classesapp/Http/Resources- JSON API resourcesapp/Models- Eloquent modelsdatabase/migrations- schema definitionsdatabase/seeders- seeded accounts, categories, settingsresources/js- Vue SPA sourceresources/views/app.blade.php- minimal SPA mountroutes/api.php- protected API routesroutes/web.php- auth JSON routes, SPA mount, signed verification/reset routes
This project is provided for application use and development purposes within this workspace.