Skip to content
BENAA homeالعربية

All work

Internal systems · Human resources · 2025

An HR system built in-house: employees, gate access and four-step leave approval

This system was built by BENAA for itself, not for a client, to show what we build when a company wants its people in one place. It holds an organisation of departments, designations and positions; employees who carry a QR badge and can be given a login; gates that log who comes in and out; leave requests that pass four approvals while the balance is counted; and a channel where a secretary passes interview requests to a manager. It has not been sold or deployed for any company.

Built by

Backend
Client
Withheld at the client’s request
Timeline
March – December 2025
Squad
1 full-stack engineer
Platform
Web · Admin application with a QR scanner in the browser
Kind
In-house product
Size
6 domains · 21 models · 30 migrations · 155 routes
Live updates
Gate scans and interview requests broadcast over Laravel Reverb
Status
Built in-house · not deployed

Technologies

  • Laravel 10
  • PHP 8.1
  • MySQL
  • Laravel Reverb
  • Laravel Echo
  • Spatie Permission
  • Spatie Laravel Data
  • Simple QR Code
  • html5-qrcode
  • Bootstrap
  • Blade
  • Vite

The product

13 images

01

Brief

One system for the people side of a company.

Context

We built this to show how one system can hold the people side of a company: who works where, who came in today, who is on leave and who a manager is going to see.

What had to be managed

Departments with their managers, designations and positions; employment types and levels; employees with a code, a QR badge, a manager and, when needed, a login; gates with a permission for each employee; leave with a balance and four signatures; and a channel from a secretary to a manager.

Goals

  • One record per person that can also become a login
  • Entry and exit logged at gates, with permission per person and gate
  • Leave approved in four steps with the balance counted
  • Roles with permissions for each section
  • A secretary’s interview requests that a manager answers

02

Team

One engineer, one module at a time.

One engineer built the system end to end during 2025, a module at a time: first the organisation chart, then roles, employees, gates, leave requests and the secretary’s channel. Most modules were built on a branch of their own, and the code is organised by domain, so the models, the data objects and the services of one part of the business sit together.

Full-stack engineerThe whole system: the domain code, the gate, leave and secretarial workflows, and the interface×1Senior

Meet the team

03

Frontend

An admin interface for every module.

Who worked on it

Backend

The interface is server-rendered Laravel Blade pages on a licensed Bootstrap admin theme. One sidebar groups HR management, the organisation structure, gates and security, leave management and secretarial management. The QR scanner runs in the browser: it starts the device’s camera or takes a code typed by hand, and shows the last scan.

The employee directory.
Adding an employee.
Departments.
Adding a role.
Creating a leave request.
  1. Decision 1

    A licensed admin theme, not a custom design

    A tested admin layout let the work go into the gate, leave and approval workflows rather than into styling a back office.

    Trade-off · The look is the theme’s, and the interface is in English: the language switch is wired but most screens are not translated yet.

  • The employee directoryEmployees are listed with their code, name, email, department and designation, and filtered by search, department, designation, status and employment type.
  • A form with a badge and accessThe employee form has general information, a QR preview that follows the code as it is typed, and a section for access to the system: the role, the display language, sending the credentials and an optional manual password.
  • Roles as permission cardsA role is a name and a card of permissions for each section, such as employee, department, designation, position and gates, each with a Check All.
  • The gates screensThe gates list with direction, scan mode and online state, the scanner, the access logs and the activity history, which filter by gate, employee, action, status and dates, and a live monitor page for one gate.
  • The leave screensLeave requests are listed by status and type, created from a form, and opened on a page with the balance cards and the four approval cards. Personnel affairs has its own form, with the working days taken from the gate logs.
  • The secretary’s sideA channel lists the interview requests with their status, a New badge on the pending ones, and buttons to view, accept, reject or reschedule each.

04

Backend & architecture

People, gates and leave in six domains, with workflows that follow the paperwork.

Who worked on it

Backend

The code is split into six domains: departments, the organisation structure (designations, positions, employment types and levels), employees, gates, leave requests and the secretarial channel. Each has its models, its data objects (Spatie Laravel Data) and its services, so the controllers stay thin. Roles and permissions use Spatie Permission, and the gate scans and interview requests are broadcast as events over Laravel Reverb.

Leave requests.
The personnel affairs approval.
The gates.
The QR scanner.
Gate access logs.
Gate activity history.
The secretary’s channel.
  1. Decision 1

    Access to the system follows a flag on the employee

    One record per person is the source of truth: ticking or unticking access creates or deactivates the login, and a change of role or contact details flows to it, so HR never maintains two lists.

    Trade-off · Behaviour hangs on an observer reacting to a field, so changing that field by any route, a seeder or a script included, changes who can log in.

  2. Decision 2

    A permission for each employee and gate, denied by default

    A gate opens only for those it was explicitly given to, and the grant is a row that can be switched off, which makes it easy to audit who could pass where.

    Trade-off · A new employee has no access anywhere until someone grants it; bulk grants soften this but do not remove it.

  3. Decision 3

    A badge that expires

    The QR payload carries a timestamp and is refused after 24 hours, so a photographed badge stops working the next day.

    Trade-off · Employees must fetch a fresh code regularly, which a printed badge cannot do.

  4. Decision 4

    The four approvals are separate records

    Each approver has a record with their own opinion, signature and fields, such as the vacation system and working days for personnel affairs and a rank for the general manager, which mirrors the paper form it replaces.

    Trade-off · The service waits for all four to approve but does not itself force the order in which they sign.

  • An employee is not a loginEvery person is an employee record, and a login exists only when “Allow access to the system” is ticked. An observer then creates the user with the employee’s role and, if asked, emails the credentials, a generated password or one set by hand. Unticking deactivates the login and keeps its record.
  • A QR badge from the employee codeAn employee’s badge is a QR code holding an encrypted payload: the code, a timestamp and a hash. It can be previewed while the code is typed and downloaded once the employee is saved, and a scan refuses a badge older than 24 hours.
  • Gates and who may passA gate has a device code, a place, a direction (entry, exit or both), a scan mode and an online state. Permissions are given for each employee and gate, one by one or in bulk, and no permission means no entry. A security user is tied to one gate and sees only that one.
  • A scan, step by stepA scan checks that the gate is active and allows that direction, that the badge is valid, that the employee exists and may use the gate. A good scan is logged and marks the gate online; a refused one is logged with its reason. Entry and exit alternate from the employee’s last scan.
  • Leave with four signaturesA request names an alternative employee, the dates and optional hours, and is refused if the balance is too low. It starts four approvals: the department manager, personnel affairs, the HR director and the general manager. When all four approve it is approved and the balance is deducted; a rejection at any level rejects it.
  • A secretary’s channelA channel pairs a manager with a secretary. The secretary adds interview requests with a visitor’s name, contact, time and notes; the manager accepts, rejects or reschedules, and notes can be added to a request. Each change is recorded and broadcast to the channel.

05

Outcome

A system we can show, kept in house.

The system was built and run locally. It has not been sold or deployed for any company, and it stands as an example of what BENAA can build for a company that wants its people, its gates and its leave in one place.

An HR system built in-house: employees, gate access and four-step leave approval

Arrow keys or a swipe to move · Esc to close

Tell us what you’re building.

A short message is enough. A senior engineer replies within 1 working day.