Developer guide

Building a business system on Laravel and Vue: a practical guide

Developer guide

Most of the systems we build for clients are not websites. They are internal business systems: clinic files, audit firm timesheets, centre schedules, order and stock flows, approval chains. They are used all day by a few dozen people, they hold data the business cannot lose, and they live for years. Laravel on the server and Vue in the browser are our stack for this kind of work, and this guide sets out the decisions that matter most when building one. It is written for developers and technical leads, and for owners who want to know what to ask of whoever builds their system.

Version facts are as published in Laravel's documentation on 1 Dec 2026: Laravel 13 is the current major release and requires PHP 8.3 or newer. For which versions still receive fixes, see our update on Laravel supported versions.

The starting point: Laravel 13 with the Vue starter kit

Laravel's official Vue starter kit is a sensible base for a new business system. According to the starter kit documentation it uses Inertia 3, the Vue 3 Composition API, TypeScript, Tailwind and the shadcn-vue component library, and authentication is handled by Laravel Fortify. Out of the box you get login, password reset, email verification and two-factor authentication with any TOTP authenticator app; two-factor is enabled by default in config/fortify.php. The kit can also be generated with team support, where each user belongs to one or more teams and team-scoped routes check membership.

Inertia lets you write Vue pages while keeping Laravel's routing and controllers, so there is no separate API to design and secure for the main web app. That suits most internal systems well. Two cases call for a token-based API alongside it:

  • A mobile app for staff or customers that talks to the same data.
  • Other systems that need to send or read data, such as an accounting package, a payment gateway callback or a WhatsApp integration. Our article on system integration through APIs covers this side.

Two practical notes from the documentation: public registration is a Fortify feature you can switch off, which most internal systems should do, and if you disable a feature you must also remove its route references in the Vue code, because the kit generates typed route definitions at build time and the build fails on routes that no longer exist.

Organise by business area, not by screen

A business system grows by area: sales, stock, finance, HR. If every controller sits in one folder and every rule lives inside controllers, the second year of the project becomes slow and risky. A structure that holds up:

  • One folder per business area (for example app/Domain/Billing, app/Domain/Scheduling) holding that area's models, actions, policies and events.
  • Actions for operations that matter. "Issue invoice", "approve leave", "close shift" each become one class with one public method. Controllers, queued jobs and console commands all call the same action, so the rule exists in one place.
  • Form requests for validation, so controllers stay short and validation rules can be tested on their own.
  • Thin controllers that authorise, call an action and return an Inertia page or a redirect.
// app/Domain/Billing/Actions/IssueInvoice.php
final class IssueInvoice
{
    public function handle(Order $order, User $by): Invoice
    {
        return DB::transaction(function () use ($order, $by) {
            $invoice = $order->invoices()->create([
                'number'       => InvoiceNumber::next(),
                'total_minor'  => $order->total_minor, // stored in the smallest currency unit
                'issued_by'    => $by->id,
            ]);

            $order->update(['status' => OrderStatus::Invoiced]);

            SendInvoiceToCustomer::dispatch($invoice)->afterCommit();

            return $invoice;
        });
    }
}

Roles and permissions with policies

Permissions are where business systems most often go wrong, usually because checks are done in the interface and not on the server. Laravel's authorisation documentation separates two tools: gates, which are closures for actions not tied to a model, and policies, which are classes that group the rules for one model or resource. In a business system almost everything is a model, so policies do most of the work.

Generate a policy with php artisan make:policy InvoicePolicy --model=Invoice, which gives you methods such as viewAny, view, create, update and delete. Laravel discovers policies automatically when the model and policy follow the naming convention. A few patterns we use:

  • A before method for the system owner role. The documentation describes before as running ahead of the other policy methods: returning true allows, false denies, and null falls through to the normal check. Keep the list of all-powerful users short.
  • Branch or company scoping inside the policy. A manager may update invoices, but only for their own branch. That condition belongs in update, next to the role check.
  • Authorise in every controller action with Gate::authorize('update', $invoice) or the can middleware on the route. A failed check becomes a 403 response automatically.
  • Send permissions to Vue for display only. The documentation notes that authorisation must always be handled on the server, and that Laravel has no fixed convention for passing it to an Inertia frontend. We share a small set of booleans through the HandleInertiaRequests middleware so the interface can hide buttons the user cannot use. Hiding a button is a courtesy; the policy is the guard.
public function update(User $user, Invoice $invoice): bool
{
    return $user->hasRole('accountant')
        && $invoice->branch_id === $user->branch_id
        && $invoice->status !== InvoiceStatus::Locked;
}

Write the permission matrix with the client before writing code: roles across the top, actions down the side. It settles disputes early and becomes the test list later.

An audit trail the business can rely on

In finance, healthcare, HR or any shared data, someone will eventually ask: who changed this, and when? Laravel does not ship an audit log, so it has to be designed. What we record for each change to an important model:

  • the user, the time and the IP address or device where useful
  • the model and its id
  • the action (created, updated, deleted, restored, or a business action like "approved")
  • the old and new values of the changed fields only

Eloquent model events or an observer can write these entries for routine changes, and actions write explicit entries for business events such as approvals. Three rules keep the log trustworthy: no screen in the system edits or deletes audit entries; passwords, tokens and similar secrets are never written into the log; and the log has its own retention period, agreed with the client and in line with the data protection law that applies to them.

Data integrity: money, numbers and deletions

Business data has to add up at the end of the month. The habits that make that possible:

  • Wrap multi-step operations in a transaction with DB::transaction, so an invoice is never created without its lines, or stock never moves without its record.
  • Store money as integers in the smallest unit (fils, halalas, piastres) or as fixed-precision decimals, never as floating-point numbers. Rounding rules for tax should be written down and tested.
  • Let the database enforce what must be true: foreign keys, unique constraints on document numbers, and non-null columns for required fields. Validation in PHP is not enough when two requests arrive together.
  • Number documents safely. Invoice and receipt numbers need to be sequential without gaps or duplicates under concurrent use; generate them inside the transaction with a lock, not from a count of existing rows.
  • Prefer soft deletes or status changes for business records. A deleted invoice that was already sent to a customer or a tax system creates more problems than it solves.
  • Dispatch jobs after commit. The queues documentation explains that with the after_commit option, or afterCommit() on a single job, a job dispatched inside a transaction waits until the transaction is committed and is discarded if it rolls back. Without it, a job can run against data that does not exist yet.

Background work: queues and the scheduler

Emails, WhatsApp messages, PDF generation, imports and reports should not run inside a web request. Laravel's queue handles them, and the documentation is clear about running it in production:

  • Run workers with php artisan queue:work and keep them alive with a process monitor such as Supervisor.
  • Workers are long-lived and keep the booted application in memory, so they do not see new code until they are restarted. Restart them on every deployment.
  • Jobs that exceed their attempts become failed jobs. Review them regularly instead of letting them pile up.

Scheduled tasks, such as daily reminders, nightly reports or expiring reservations, run through Laravel's scheduler, which needs a single cron entry on the server that calls schedule:run every minute. Use withoutOverlapping() for tasks that may run longer than their interval, and onOneServer() if the system runs on more than one server; the documentation notes that the latter needs a shared cache driver such as database or Redis.

# crontab of the deploy user
* * * * * cd /var/www/app && php artisan schedule:run >> /dev/null 2>&1

Arabic and right-to-left in the Vue interface

Most of our systems are used in Arabic first, with English for some users. Planning for this from the first screen is far cheaper than retrofitting it:

  • Set lang and dir on the root element from the user's language, and switch both together.
  • Use logical CSS properties (start and end rather than left and right). In Tailwind that means classes such as ms-4, pe-2 and text-start, so the same component works in both directions.
  • Mirror icons that point, such as arrows and chevrons, and leave the rest alone.
  • Decide on digits once: Western digits or Arabic-Indic digits, applied consistently in tables, inputs and printed documents. Store numbers and dates in a neutral format and format them only for display.
  • Keep translations in files, not in components, and give translators the context of each string.
  • Test printed documents such as invoices and reports in Arabic early, because PDF tools differ in how they shape Arabic text.

Deployment that does not surprise you

Laravel's deployment documentation gives the base rules. The server needs PHP 8.3 or newer for Laravel 13 with the required extensions, and the web server must point to the public directory, never to the project root, which would expose configuration files. The web server user needs write access to storage and bootstrap/cache. APP_DEBUG must be false in production; the documentation warns that leaving it on can expose sensitive configuration to users.

A deployment we trust follows the same steps every time:

php artisan down --retry=60           # optional for migrations that lock tables
git pull --ff-only
composer install --no-dev --optimize-autoloader
npm ci && npm run build
php artisan migrate --force
php artisan optimize                  # caches config, events, routes and views
php artisan reload                    # restarts queue workers and other long-running services
php artisan up

Two warnings from the documentation are worth repeating. After config:cache (part of optimize), the .env file is no longer loaded, so env() must only be called inside configuration files. And Laravel provides a health route, /up by default, that returns 200 when the application boots and 500 when it does not; point your uptime monitor at it.

If the system runs on your own server or a VPS, our hosting service covers the server side: PHP versions, backups, monitoring and updates.

Tests that protect the business rules

You do not need full coverage to get most of the value. In business systems we test, in this order:

  1. Policies: each role against each sensitive action, straight from the permission matrix.
  2. Actions that move money or stock, including the failure path where the transaction must roll back.
  3. Document numbering under repeated and parallel calls.
  4. Imports and integrations with real sample files from the client.

Run these on every push. A failing policy test is much cheaper than a user seeing another branch's invoices.

Checklist before go-live

  • Public registration off; two-factor authentication required for admin roles.
  • Every controller action authorised on the server; permission matrix covered by tests.
  • Audit entries written for important models and business actions, with no edit screen.
  • Money stored as integers or fixed decimals; document numbers unique and gap-free.
  • Jobs dispatched after commit; workers under Supervisor; failed jobs reviewed.
  • Scheduler cron entry in place; long tasks protected against overlap.
  • Arabic and English layouts checked, including printed documents.
  • Web root set to public, APP_DEBUG=false, optimize and reload in the deploy script.
  • Health route monitored; backups tested by an actual restore.

If you would rather have this built for you, this is the core of our custom software service.

FAQ

Should a business system use Inertia or a separate Vue app with an API?

For the main web interface, Inertia is usually simpler: one codebase, Laravel routing and sessions, and no public API to secure. Add a token-based API when a mobile app or another system needs the same data. Many of our systems use both.

Is a permissions package required, or are Laravel policies enough?

Policies handle the rules for each model and action. If roles and their permissions must be edited by administrators from a screen, you will also need tables to store them, which you can build or take from a well-maintained package. Either way, the checks themselves should still run through policies.

How do we keep queue workers running on a normal VPS?

Laravel's documentation recommends a process monitor such as Supervisor to keep queue:work running and restart it if it stops. Restart workers on every deployment, because they keep the old code in memory until restarted.

Which PHP version should a new Laravel system run on?

Laravel 13 requires PHP 8.3 or newer and supports up to PHP 8.5 according to its release notes. Choose a PHP version that still receives active support, so the server does not need an urgent upgrade soon after launch.

How should we handle Arabic numbers and dates?

Store numbers and dates in a neutral format in the database and format them only when displaying them. Decide once whether the interface uses Western or Arabic-Indic digits, and apply the choice everywhere, including PDFs and exports.

Do we need zero-downtime deployment?

For most internal systems a short maintenance window is acceptable if it happens outside working hours. If the system is used around the clock, use a release-folder approach or a managed platform, and keep migrations backwards compatible so old and new code can run briefly side by side.

Official sources

Visual Innovate

Written by the Visual Innovate team, the people who build, host and follow up systems, websites and apps for our clients in Jordan, Saudi Arabia, Oman and Egypt. We follow the official sources and update this page when something changes.

Are you our next Success Partner?

Tell us the problem as you see it. Within one working day we'll come back with how we understand it and a clear first step.