Bui Thanh ChienWordPress · Excel · automation · Vietnam, GMT+7

Repair shop job tickets: a Laravel API and admin page

A job-ticket API with token sign-in, a strict status workflow and a filterable admin page, covered by 20 feature tests.

Demo project, fictional brand · Laravel

Admin ticket list on desktop, with status counts, filters and a table
Admin page on desktop, 12 invented tickets See it filtered

The problem

A small repair shop tracks jobs on paper and loses them. It needs one place where tickets are created, move forward in order, and can be found again, from a script or from a browser.

How it was tested

Endpoints

CallWhat it does
POST /api/loginChecks the staff login and returns an API token.
GET /api/ticketsPaginated list. Filters: status, priority, search text, per_page.
POST /api/ticketsCreates a ticket. It always starts as open.
GET /api/tickets/{id}One ticket, or 404.
PATCH /api/tickets/{id}Edits fields. It cannot change the status.
PATCH /api/tickets/{id}/statusMoves a ticket one step: open, in progress, done. Any other jump returns 422.
DELETE /api/tickets/{id}Removes a ticket (204).

Every ticket call needs a Bearer token and answers 401 without one. Errors come back as JSON with one message per field.

What I built

Code excerpt

enum TicketStatus: string
{
    case Open = 'open';
    case InProgress = 'in_progress';
    case Done = 'done';

    public function next(): ?self
    {
        return match ($this) {
            self::Open => self::InProgress,
            self::InProgress => self::Done,
            self::Done => null,
        };
    }

    public function canMoveTo(self $target): bool
    {
        return $this->next() === $target;
    }
}

// UpdateStatusRequest: the workflow check runs with validation
if (! $ticket->status->canMoveTo($target)) {
    $validator->errors()->add('status',
        "A ticket that is {$ticket->status->value} cannot move to {$target->value}.");
}

Only a short excerpt. The whole app is not published.

Screens

Admin page on a phone, tickets as stacked cards
Admin page on a phone See the full page

Built with: Laravel, PHP, Sanctum, SQLite, Blade, PHPUnit

Tell me how your team tracks work today and I will sketch the tickets and steps first.Contact me