Human Resource Management is the backbone of any organization. From tracking employee attendance and processing payroll to managing performance reviews and handling exits, the complexity grows exponentially with team size. I set out to build a complete, production-ready HRMS (Human Resource Management System) using Laravel 10 — covering the full employee lifecycle with 20+ integrated modules.
In this post, I'll walk through the architecture, key modules, technical decisions, and what it takes to build an enterprise-grade HR platform from scratch.
Project Overview
The HRMS is a full-featured platform built to manage every aspect of human resources in a single system. It supports employee management, attendance tracking, leave management, payroll processing, performance reviews, expense claims, asset tracking, shift scheduling, timesheets, travel management, exit management, a helpdesk ticketing system, and much more.
Tech Stack:
- Backend: Laravel 10 / PHP 8.2+
- Database: MySQL
- Frontend: Blade Templates + Bootstrap 5
- Libraries: jQuery, Axios, DataTables (server-side), SweetAlert2, Toastr, Select2, Flatpickr, Chart.js
- Architecture: Repository + Service Pattern
- Authentication: Laravel built-in auth with custom roles & permissions (built from scratch)
System Architecture
The application follows a clean Repository + Service Pattern that separates concerns into three layers:
- Controllers — Handle HTTP requests and responses, thin as possible
- Services — Contain all business logic (LeaveService, PayrollService, AttendanceService, etc.)
- Repositories — Handle all database queries and interactions
This pattern makes the codebase highly testable, maintainable, and scalable. Adding new features or modifying existing logic rarely requires changes across multiple layers.
Key Architectural Decisions
- Custom RBAC (Role-Based Access Control): Built from scratch without Spatie. A Permission → Role → User mapping system with middleware-based runtime checks. Three default roles: Owner, Admin, Employee, with granular module-level permissions.
- Multi-Company Ready: Every model, query, and relationship is scoped by
company_id, making the system ready for SaaS deployment with complete data isolation between organizations. - AJAX Modal CRUD: All create and edit operations use AJAX-loaded modals with real-time validation. Deletes use SweetAlert2 confirmations. Server-side DataTables handle pagination, searching, and sorting across all listing pages.
- Dark Mode: User preference for dark/light theme persisted in localStorage and applied instantly via CSS custom properties — no page reload required.
- Comprehensive Audit Logging: A global audit helper (
logAudit()) tracks every user action across all modules with before/after state, IP address, and user agent for full traceability.
Module Deep Dive
1. Employee Management
Complete employee profiles with departments, designations, document uploads, and contact information. Supports profile photos, emergency contacts, and employment history.
2. Attendance Tracking
Clock in/out functionality with break tracking, overtime calculation, and daily attendance logs. The system automatically computes working hours, late arrivals, and early departures.
3. Leave Management
Employees can apply for leave, managers can approve or reject. The system tracks leave balances per type (sick, casual, annual, etc.), shows a holiday calendar, and prevents overuse.
4. Payroll Processing
Configurable salary components (basic, HRA, allowances, deductions), automated payroll processing, and payslip generation. Salary trends and payroll reports give finance teams full visibility.
5. Performance Reviews
Supports review cycles with goals and KPIs, self-review, manager review, and 360-degree feedback. Configurable rating scales and automated review reminders.
6. Expense Management
Employees submit expense claims with receipt uploads. The workflow moves from pending → approved → paid with full audit trail at each step.
7. Asset Management
Track company assets (laptops, phones, etc.) through their lifecycle. Assign assets to employees, track returns, and monitor asset status.
8. Shift Scheduling
Define shift types, create daily rosters, and handle shift swap requests with approval workflow — essential for organizations with rotating schedules.
9. Timesheets
Project-based time tracking with approval workflow. Employees log hours against projects, managers review and approve.
10. Helpdesk / Tickets
Internal ticketing system for HR and IT support. Ticket creation, assignment, priority levels, comments, and status workflow (open → in progress → resolved → closed).
11. Reports & Analytics
Dashboard with attendance trends, leave patterns, payroll summaries, headcount analytics, and turnover rates. Charts powered by Chart.js with export capabilities.
12. Org Chart
Visual organizational chart showing the company hierarchy with employee cards. Interactive and collapsible for easy navigation.
Demo & Source Code
The complete source code is available on GitHub. You can clone the repository, run the migrations with seeders, and start exploring all modules immediately with realistic demo data.
GitHub Repository:
https://github.com/mkdaraniya/laravel-hrms
Demo Credentials (after local setup):
- Owner: owner@example.com /
Admin@123456 - Admin: admin@example.com /
Admin@123456 - Employee: employee@example.com /
Admin@123456
Additional employee accounts follow the pattern firstname@example.com (e.g., priya@example.com) with password Admin@123456.
Installation
git clone https://github.com/mkdaraniya/laravel-hrms.git hrms
cd hrms
composer install
cp .env.example .env
php artisan key:generate
# Create MySQL database 'hrms' and update .env
php artisan migrate --seed
php artisan serveThe seeder populates the system with 1 company, 8 departments, 30+ designations, 3 roles, 20 employees, 6 leave types, 20+ holidays, 3 months of payroll and attendance data, 100+ timesheet entries, expense records, asset assignments, and more — giving you a fully functional demo out of the box.
Key Takeaways
Building a comprehensive HRMS from scratch taught me several important lessons:
- Architecture matters. The Repository + Service pattern paid dividends as the codebase grew — adding the 15th module was as clean as adding the first.
- Custom permissions are worth building. While packages like Spatie are great, building a custom RBAC system gave us exactly what we needed without unnecessary complexity.
- AJAX modals improve UX significantly. Users never leave the page for CRUD operations — everything happens in modals with instant feedback via Toastr notifications.
- Demo data is crucial. Comprehensive seeders make onboarding new developers (or demoing to clients) seamless — no need to manually create test data.
If you're looking for a solid foundation for an HR platform or want to contribute, the code is open source on GitHub. Feel free to explore, fork, and build upon it.