Coming from Laravel
On this page 8
If you already know Laravel, you already understand how Stacks is organized. Stacks follows the same convention-over-configuration philosophy (models, migrations, actions, middleware, queues, mailables, scheduler, and a single CLI), written natively in TypeScript for Bun, with every first-party package open source under MIT.
Ecosystem Comparison
Where Laravel splits advanced capabilities into paid products or separate packages, Stacks ships them integrated out of the box:
| Laravel Ecosystem | Stacks Equivalent | License |
|---|---|---|
| Laravel Framework | stacks + @stacksjs/* | MIT (Open Source) |
Artisan (php artisan) | Buddy (./buddy) | MIT (Open Source) |
| Eloquent ORM + hand-written migrations | defineModel() + auto-derived migrations (./buddy migrate) | MIT (Open Source) |
| Blade / Livewire / Inertia | stx templates (server blocks, fine-grained signals, components) | MIT (Open Source) |
| Laravel Nova / Filament | Built-in Admin Dashboard (./buddy dev:dashboard) | MIT (Open Source) |
| Laravel Spark / Cashier | @stacksjs/commerce + @stacksjs/payments (Stripe, Paddle, Adyen) | MIT (Open Source) |
| Laravel Forge / Vapor / Cloud | @stacksjs/cloud + ts-cloud (./buddy deploy) | MIT (Open Source) |
| Laravel Pulse / Telescope / Debugbar | @stacksjs/debugbar + query monitoring | MIT (Open Source) |
| Laravel Horizon | @stacksjs/queue (sync, database, redis) | MIT (Open Source) |
| Laravel Reverb | @stacksjs/realtime (native Bun WebSockets + durable replay) | MIT (Open Source) |
| Laravel Scout | @stacksjs/search-engine (Meilisearch, Algolia, Typesense, OpenSearch) | MIT (Open Source) |
| Laravel Sanctum / Socialite / Fortify | @stacksjs/auth (tokens, cookies, passkeys, 2FA/TOTP, OAuth, RBAC) | MIT (Open Source) |
| Dependabot / Renovate | @buddysh/buddy (buddy audit with transitive lockfile CVSS/SARIF reports) | MIT (Open Source) |
Concept Map
CLI Commands
Laravel (php artisan) | Stacks (./buddy) |
|---|---|
php artisan serve | ./buddy dev (production: ./buddy serve) |
php artisan migrate | ./buddy migrate |
php artisan migrate:fresh --seed | ./buddy migrate:fresh --seed |
php artisan make:model Post -m | ./buddy make:model Post (migrations derive automatically from the model) |
php artisan make:controller PostController | ./buddy make:action PostStoreAction |
php artisan route:list | ./buddy route:list |
php artisan tinker | ./buddy tinker |
php artisan queue:work | ./buddy queue:work |
php artisan test | ./buddy test |
php artisan down / up | ./buddy down / ./buddy up |
Models & Migrations
In Laravel, you define a model class and hand-write separate migration files. In Stacks, defineModel() is the single source of truth for your schema, validation rules, factory, relationships, and optional CRUD API routes (useApi), and ./buddy migrate diffs your models against the database automatically.
// app/Models/Post.ts
import { defineModel } from '@stacksjs/orm'
import { schema } from '@stacksjs/validation'
export default defineModel({
name: 'Post',
table: 'posts',
traits: {
useTimestamps: true,
useSearch: true,
useApi: { uri: 'posts' },
},
belongsTo: ['User'],
attributes: {
title: {
validation: { rule: schema.string().min(3).max(160) },
factory: faker => faker.lorem.sentence(),
},
body: {
validation: { rule: schema.string().min(10) },
factory: faker => faker.lorem.paragraphs(2),
},
},
})
Actions Instead of Fat Controllers
Stacks uses single-purpose Action classes under app/Actions/ with built-in request validation, typed parameters, and automatic OpenAPI schema generation:
// app/Actions/PostStoreAction.ts
import { Action } from '@stacksjs/actions'
import { response } from '@stacksjs/router'
import { schema } from '@stacksjs/validation'
export default new Action({
name: 'PostStoreAction',
method: 'POST',
validations: {
title: { rule: schema.string().min(3).max(160) },
body: { rule: schema.string().min(10) },
},
async handle(request) {
const post = await Post.create({
title: request.get('title'),
body: request.get('body'),
})
return response.created(post)
},
})
Routing & Middleware
Routes in routes/api.ts and routes/web.ts mirror Laravel's fluent router API:
import { route } from '@stacksjs/router'
route.group({ prefix: '/v1', middleware: ['auth', 'throttle'] }, () => {
route.get('/posts', 'Actions/PostIndexAction')
route.post('/posts', 'Actions/PostStoreAction')
})
CSRF protection is enabled by default on state-changing browser requests (POST/PUT/PATCH/DELETE), while Authorization: Bearer API requests bypass CSRF automatically.
The app/ Override Model
Stacks ships 113 built-in models, 785 default actions, and a full admin dashboard in @stacksjs/defaults. You never need to eject the framework to customize behavior: create a file at the matching path in app/ (for example app/Actions/Cms/PostIndexAction.ts) and your file takes precedence automatically.
Next Steps
- Quick Start - Create your first Stacks project with
panx buddy new my-app - Driver Capabilities - See live CI evidence and exact limits for every database, queue, cache, storage, mail, and deploy driver
- Upgrade Guide - Semver expectations and upgrade steps between releases