HUMAN RESOURCE PLATFORM
A Laravel web platform for managing employee records — secured behind a login, searchable across every key field, and backed by a cloud PostgreSQL database on Supabase.
OVERVIEW
HRP replaces spreadsheet-style employee records with a small, focused web application. HR staff sign in, then add, browse, search, edit, and remove employees — with every change validated on the server before it reaches the database.
It is built the conventional Laravel way on purpose: routes, controllers, Eloquent models, migrations, and Blade views, so the codebase stays predictable for anyone who knows the framework.
ARCHITECTURE
auth middleware group, so an unauthenticated request never reaches a controller.Employee model with mass-assignment whitelisting and type casts, and a SupabaseUser model mapped onto an existing users table.DATA MODEL
- id — auto-increment key
- empName, dateOfBirth
- branch, department, rank
- salary — DECIMAL(10,2)
- email — unique, phone
- created_at, updated_at
- userName — string primary key
- password — bcrypt hash
WHAT IT DOES
- Search across six fields: one box matches name, rank, email, phone, branch, or department, with results paginated 15 per page.
- Rules enforced on the server: a name and date of birth are required, employees must be at least 18, salary cannot be negative, and email must be valid and unique.
- Full record lifecycle: create, view, edit, and delete, each confirmed with a flash message.
- Protected access: session-based login with an optional “remember me”, session regeneration on sign-in, and logout.
A DESIGN DECISION WORTH NOTING
The users table already existed in Supabase, and some accounts still held plain-text passwords. Rather than force a reset, the login checks the bcrypt hash first; if an old plain-text password matches, the user is signed in and the password is re-saved as a hash on the spot. Every account moves to hashed storage the first time its owner logs in, with no migration script and no interruption.
RUN IT LOCALLY
git clone https://github.com/AAFLY99/HRP.git cd HRP composer install cp .env.example .env # set the Supabase PostgreSQL connection php artisan key:generate php artisan migrate php artisan serve