How the Third Party Inspection app is put together and how a vendor PO moves to a released IRN. Laravel 13 and MySQL on cPanel shared hosting, with email-code sign-in and branded emails. Staff run the workflow; customers sign in to a read-only portal that shows only their own orders.
System components
Staff and customers use the same web app from a browser or phone. All files and data stay on the cPanel account; email is the only thing that leaves it.
Blue arrows are web requests; gold arrows are email. Mail is queued in MySQL and sent by the per-minute cron, so a slow mail server never holds up a screen.
Inspection workflow
Each row is a role. A PO is split into items, each item into the inspection stages ticked for it, and every stage moves through its own status.
Solid arrows are the normal path. Dashed arrows send work back: orange to the same inspector, red to the coordinator for a new visit. Every action is written to the activity log. Customers see each stage move in their portal as it happens.
Who can do what
Role
Masters, POs, items
Assign visits
Submit reports
Approve, IR, IRN
Reports
Staff, settings, log
Administrator
Yes
Yes
Yes
Yes
Yes
Yes
Resource coordinator
View POs, upload control files
Yes
–
–
Yes
–
Inspector
–
–
Own visits only
–
–
–
Technical head
View
–
–
Yes
Yes
–
Viewer
View
–
–
–
View
–
Customer
Own client's POs and items only (progress)
–
–
–
Own approved IR / IRN
–
Welcome email
When an admin adds a staff member or customer login with Send a welcome email ticked (the default), the person gets a branded email telling them where to go, which email to sign in with, what role they have and what that role can do. There is no password: the email explains the emailed-code sign-in.
Gold is email. Like every other email it goes through the mail queue, so saving the user never waits on the mail server. Covered by tests in tests/Feature/WelcomeEmailTest.php.
Workflow emails
Each step of an inspection sends its own branded email, in the same style as the welcome email: logo and gold rule, a coloured status label, a five-step tracker (Assigned → Report submitted → Technical review → Approved (IR) → IRN released) showing where the job is, the key numbers as tiles, a details table and one button that opens the right page. They work in light and dark mode, on phones, and in Outlook.
When
To (copy)
What it shows
Button
Visit assigned
Inspector (coordinator)
Scheduled dates, location, qty, coordinator's instructions, PO / item / stage, what the report must include
Open inspection
Visit details changed
Inspector (coordinator)
Same email marked "Inspection updated". A new inspector gets the normal assigned email
Open inspection
Report submitted
All active Technical Heads (coordinator)
Offered / accepted / rejected qty, inspector's remarks, photo count, stage qty, how many reports are waiting. Marked "Resubmitted after hold" the second time
Review report
Approved
Inspector (coordinator)
IR number, accepted qty, stage balance, reviewer's remarks
View report
On hold
Inspector (coordinator)
The reason, who gave it and when, what to do next
Update and resubmit
Rejected
Inspector (coordinator)
The reason, plus a next-step note for the coordinator to assign a re-inspection for the balance
View report
IRN released
Inspector (coordinator)
IRN and IR numbers, released qty, "Item complete" when every stage is done
View / print IRN
IRN released
The client's customer logins
Their PO, item, stage, IR / IRN numbers. No internal remarks
Views in resources/views/emails/inspection/, shared layout emails/layouts/tpi and parts in emails/partials/
Sent from the Assignment, Inspection and Review controllers through Notify::send (queued; a mail error never blocks the action)
Settings
Send workflow emails turns all of them on or off
Also email the client's customer logins when an IRN is released (on by default)
Workflow email previews: open any email with sample data; nothing is sent
Tests
tests/Feature/WorkflowEmailTest.php walks assign → submit → hold → resubmit → reject, and approve → IRN, checking recipients, subjects and the reason text
Run against MySQL strict mode as well as SQLite
Customer portal
A customer login is a user with the role client and a client_id. It opens only the portal screens, and every query there is filtered to that client's vendor POs. It cannot change anything.
Gold is the customer path. The portal reuses the same IR / IRN print page as staff, but only for reports that already have an IR number. Covered by tests in tests/Feature/CustomerPortalTest.php.
Routes
GET /portal · My Orders
GET /portal/orders/{po} · order detail
GET /portal/completed · completed items and reports
GET /portal/reports/{report}/print · IR, or IRN with ?doc=irn
/dashboard sends customers to /portal
Files
/files/photo/{id} is allowed only for photos of an approved report on the customer's own PO
PO documents and stage control files stay staff-only