← BACK TO PORTFOLIO

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.

RoleFull-stack Developer
StackPHP 8.2, Laravel 12, Blade
DatabasePostgreSQL 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

01Routing & middlewareThe login page is public; every employee route sits inside an auth middleware group, so an unauthenticated request never reaches a controller.
02ControllersA resource controller handles the seven standard actions (index, create, store, show, edit, update, destroy); a separate login controller owns authentication.
03ValidationStore and update requests are validated in the controller before any write, and errors are sent back to the form.
04Eloquent modelsAn Employee model with mass-assignment whitelisting and type casts, and a SupabaseUser model mapped onto an existing users table.
05Blade viewsA shared layout and navbar, plus list, create, edit, and detail pages for employees.

DATA MODEL

employees
  • id — auto-increment key
  • empName, dateOfBirth
  • branch, department, rank
  • salary — DECIMAL(10,2)
  • email — unique, phone
  • created_at, updated_at
Users (Supabase)
  • 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

NEXT STEPS

Normalized structure
Move branch, department, and rank into their own tables with foreign keys instead of free text.
Attendance & roles
Add attendance tracking and role-based permissions for HR staff versus managers.
Tests
Feature tests for validation rules and the password-upgrade path.