What the generated Laravel app contains
Application structure
app/
Http/
Controllers/
Api/
AuthController.php # Sanctum login, logout, register
{Entity}Controller.php # resourceful controller per entity
Middleware/
EnsureWorkspace.php # tenant scoping middleware
Requests/
{Entity}StoreRequest.php # Form Request validation
{Entity}UpdateRequest.php
Resources/
{Entity}Resource.php # API Resource (no accidental data leaks)
{Entity}Collection.php
Models/
User.php # HasApiTokens (Sanctum)
Workspace.php
{Entity}.php # Eloquent model with $fillable, $hidden, casts
Policies/
{Entity}Policy.php # authorization per entity (Gate + Policy)
Services/
{Entity}Service.php # business logic separate from controllers
Notifications/
WelcomeEmail.php
PasswordResetNotification.php
database/
migrations/
2024_01_01_000001_create_{entities}_table.php # one per entity
factories/
{Entity}Factory.php # Faker factories for testing
seeders/
DatabaseSeeder.php
routes/
api.php # versioned API routes: /api/v1/...
config/
sanctum.php
cors.php
tests/
Feature/
Api/
{Entity}ControllerTest.php
Unit/
{Entity}ServiceTest.php
frontend/ # Next.js app
app/
(auth)/
login/page.tsx
register/page.tsx
(protected)/
{entity}/
page.tsx # list view
[id]/page.tsx # detail view
Dockerfile
docker-compose.yml
Makefile
Database layer
- Eloquent ORM — no raw SQL queries
- One migration file per entity, version-controlled with Artisan
- All foreign key columns indexed (
->index()) - Multi-tenant scoping: every protected query filters by
workspace_id - Soft deletes on entities where data retention matters
- PostgreSQL — never SQLite
Auth and security
- Laravel Sanctum for API token auth (tokens stored in
personal_access_tokenstable, not cookies) {Entity}Policyclass for every entity —Gate::authorize()before every write operationForm Requestvalidation on every POST/PUT — no raw$request->all()in controllers- Secrets from
env()only —.env.exampledocuments every required variable - Rate limiting on
POST /api/auth/*viathrottle:6,1middleware
API design
- Resourceful controllers:
index,store,show,update,destroy - Routes match the generated OpenAPI 3.1 spec
{Entity}Resourcetransformer — never expose model internals directly- Consistent error format:
{"error": "snake_case_code", "message": "Human readable description."} - 201 for creation, 422 for validation errors, 403 for auth/permission, 404 for not found
- Pagination via
{Entity}Collectionusing Laravel's built-in paginator
Tests
- PHPUnit test suite with feature tests and unit tests
RefreshDatabasetrait for transaction rollback between tests- Factory-based test data — no hard-coded fixtures
- Auth tests: Sanctum token issuance, revocation, middleware enforcement
- Policy tests: unauthorized access correctly blocked per entity
Infrastructure
- Multi-stage Dockerfile (composer:latest → php:8.3-fpm-alpine production)
docker-compose.yml: PHP-FPM + Nginx + PostgreSQL + Redis (for queues and cache)Makefile:make dev,make test,make migrate,make seed- GitHub Actions:
pintlint →phpstan→phpunit→docker build→ deploy
Laravel vs other PHP frameworks
Choose Laravel when:
- Your team knows PHP and wants a batteries-included framework
- You need the Eloquent ORM, Artisan commands, and the Laravel ecosystem
- You're building a product that may grow to use Laravel Queues, Events, Notifications, and Broadcasting
- Rapid feature velocity matters more than micro-optimization
Laravel is the dominant choice for PHP backends. More Laravel applications are in production than any other PHP framework. Hiring is straightforward, community support is comprehensive, and the framework is actively maintained.
vs Laravel Breeze, Jetstream, and cookiecutter-laravel
Laravel Breeze and Jetstream scaffold auth UI. Cookiecutter starters scaffold a project structure.
What they don't give you: your entities, your controllers, your business logic, your migrations, your tests — the 80% of the application that is specific to your product.
Archiet starts where those tools end.
CTA
Generate a complete Laravel + Next.js application from your requirements — free plan, no credit card.
Describe your product, pick Laravel, download a production-ready codebase in 90 seconds.
Start free at archiet.com.