Skip to content
Laravel Packagev13.xMIT License11+ downloadsAI Ready · Laravel Boost

Architecture: Structure your use cases without a framework on top

Architecture gives your Laravel application Actions for use cases, Tasks for reusable steps, Services for business and integration code, typed Data objects and Contexts. Each one is a small abstract class built on Laravel's container and pipeline, so your code stays plain Laravel and you adopt only the pieces you need. It is AI ready: php artisan boost:install teaches your coding agent the whole package through Laravel Boost.

$composer require pharaonic/laravel-architecture

Compatibility

Each line is released for the versions in its row, read from that release's composer.json. Pick the line that matches your project; a combination not listed isn't supported. Find the right line of every package for your project.

LineLatest releasePHPLaravelStatusDocs
v13.xv13.0.0 Nov 30, 20268.3 – 8.513Current Docs: Read the v13.x docs
v12.xv12.0.0 Nov 30, 20268.2 – 8.512Maintained Docs: Read the v12.x docs
v11.xv11.0.0 Nov 30, 20268.2 – 8.411MaintainedLaravel 11 no longer gets security fixes Docs: Read the v11.x docs
v10.xv10.0.0 Nov 30, 20268.1 – 8.310MaintainedLaravel 10 no longer gets security fixes Docs: Read the v10.x docs
v9.xv9.0.0 Nov 30, 20268.0 – 8.29MaintainedLaravel 9 no longer gets security fixes Docs: Read the v9.x docs
v8.xv8.0.0 Nov 30, 20268.0 – 8.18MaintainedLaravel 8 no longer gets security fixes Docs: Read the v8.x docs
v7.xv7.0.0 Nov 30, 20268.07MaintainedLaravel 7 no longer gets security fixes Docs: Read the v7.x docs
v6.xv6.0.0 Nov 30, 20268.06MaintainedLaravel 6 no longer gets security fixes Docs: Read the v6.x docs

Maintenance

Latest release
v13.0.0
Nov 30, 2026 (15 hours ago)
Released lines
8
documented lines with a release; see compatibility
CI on develop
Tests passed
latest run Nov 30, 2026

From the package's releases and its GitHub Actions. A passing run means the test suite passed on develop, on every PHP version it supports; it isn't a security review, and each release line has its own runs on GitHub. Checked hourly.

A quick look

A use case as an Action that sends a Context through a task pipeline.

app/Actions/PlaceOrderAction.php
1class PlaceOrderAction extends Action
2{
3 public function handle(OrderContext $context): Order
4 {
5 return DB::transaction(fn () => $this->tasks($context, [
6 CalculateTotalTask::class,
7 ReserveStockTask::class,
8 CreateOrderTask::class,
9 ])->order);
10 }
11}
12 
13$order = PlaceOrderAction::make()->handle(new OrderContext($user, $items));
Key Features

Everything a clean Laravel codebase needs

Five base classes and five generators, with no configuration and nothing running behind your back.

Actions and Tasks

One class per use case or step, with make(), constructor injection and an invokable handle().

Task Pipelines

$this->tasks($payload, [...]) runs Laravel's own pipeline: classes, parameters and closures.

Service Categories

Business, Integration and Boundary services share one Service class and differ only by convention.

Typed Data Objects

fromArray(), fromRequest() and fromModel() with strict types, plus #[MapName], #[Hidden] and #[DataCollection].

Generators

make:action, make:task --pipeline, make:service --integration and more, with custom PSR-4 paths.

AI Ready

Ships a Laravel Boost guideline and an architecture-development skill, so php artisan boost:install teaches Claude Code, Cursor, Codex or Copilot the whole API.

FAQ

Architecture Questions

Quick answers about installing and using Architecture.

What is Architecture?

A lightweight application architecture for Laravel with Actions, Tasks, Services, typed Data objects and Contexts, plus their Artisan generators, built on the container and pipeline Laravel already ships. It's a free, open-source Laravel package by Pharaonic.

How do I install Architecture?

Run composer require pharaonic/laravel-architecture in your project's root directory.

What does Architecture require?

The latest release requires PHP 8.3 – 8.5 and Laravel 13.

Does it enforce the architecture?

No. The dependency rules are recommendations in the documentation. Nothing validates, intercepts or wraps your calls at runtime, and you can adopt one class without the others.

Do I have to use modules?

No. The generators write to app/ by default and accept a --path for any folder your composer.json maps with PSR-4, with or without a modules package.

Does it handle database transactions?

No, on purpose. Wrap the writes that belong together in DB::transaction() inside your Action, as you would anywhere else in Laravel.

How do I test code that uses Actions and Services?

make() resolves through the container, so Laravel's $this->mock(), bindings and fakes work as usual.

Is Architecture free to use?

Yes. Architecture is open source under the MIT license, so you can use it in personal and commercial projects.

Where can I find the Architecture documentation?

Read the Architecture documentation for setup, configuration, and usage examples.

How do I report a bug or contribute to Architecture?

Open an issue or a pull request on GitHub, ask in GitHub Discussions, or chat with us on Discord.

Ready to dig in?

Read the full documentation for Actions, Tasks and pipelines, the three Service categories, Data objects and their attributes, Contexts, the generators, and the dependency guidelines.