What You Will Build
A production-ready Laravel codebase for a B2B SaaS, generated from a paragraph. The generated app includes:
- Eloquent models with migrations (
php artisan migrateready) - Resource controllers, one per entity
- Sanctum token authentication
- Organisation-scoped multi-tenancy via a global scope
- A working
docker-compose.yml
Laravel is the right pick for PHP teams and agencies who want a productive, convention-driven framework with a huge ecosystem.
Prerequisites
- An Archiet account (free at archiet.com/register)
- Docker installed locally
- 10 minutes
Step 1: Write a Minimal PRD
Bookings is a B2B SaaS for studios. Organisations sign up and invite staff.
Staff manage rooms (name, capacity) and reservations (room, customer name,
start time, end time, status). Only staff in an organisation see that
organisation's rooms and reservations. We need registration, login, email
verification, and password reset.
Archiet extracts Organisation, User, Room, and Reservation, plus the auth flow.
Step 2: Open the Blueprint Wizard
Log in at archiet.com/login, click New Blueprint, paste the PRD, click Analyse, review the model.
Step 3: Choose Laravel
On the Generate screen, select Laravel and click Generate.
Step 4: What You Get
bookings/
├── app/
│ ├── Models/
│ │ ├── Organisation.php
│ │ ├── Room.php
│ │ └── Reservation.php
│ ├── Http/Controllers/
│ │ ├── RoomController.php
│ │ └── ReservationController.php
│ └── Scopes/OrganisationScope.php
├── database/migrations/
├── routes/api.php
├── docker-compose.yml
└── artisan
The Eloquent model applies a global scope so every query is automatically tenant-filtered:
// app/Models/Reservation.php
class Reservation extends Model
{
protected $fillable = ['room_id', 'customer_name', 'start_time', 'end_time', 'status'];
protected static function booted(): void
{
static::addGlobalScope(new OrganisationScope);
}
}
// app/Http/Controllers/ReservationController.php
class ReservationController extends Controller
{
public function index(): JsonResponse
{
// OrganisationScope already filters to auth()->user()->org_id
return response()->json(Reservation::all());
}
}
The OrganisationScope means a developer cannot accidentally leak another organisation's data — the filter is applied to every query by default.
Step 5: Run It Locally
cd bookings
cp .env.example .env
docker compose up -d
docker compose exec app php artisan migrate
# or locally:
php artisan serve
The API is at http://localhost:8000/api/. Register, verify your email, and authenticate with Sanctum.
What to Do Next
Use the ecosystem: the generated app is standard Laravel, so packages for queues, notifications, and Horizon all apply.
Add a Blade or Inertia frontend: the API is clean; bolt on whatever frontend your team prefers.
Other stacks: Rails offers a similar convention-driven experience in Ruby; Django in Python.
The generated ARCHITECTURE.md documents the multi-tenancy approach (global scope vs. manual filtering) and the auth decisions.