✨ Vertical Slice Architecture for Laravel 13+ & Flutter Zero Third-Party Lock-in

Stop building monoliths.
Scale with Vertical Slices.

LaraSlice replaces scattered controllers, models, and migrations with cohesive, autonomous domain slices. Generate enterprise modules via Visual Studio UI, Artisan CLI, or Autonomous AI prompts — complete with typed DTO contracts, native RBAC, compliance audit trails, and Flutter exports.

⚠️ Prerequisite: Requires an existing Laravel 11, 12, or 13 project
composer require hereafter/laraslice && php artisan slice:install
View on GitHub ↗
3 Ways
UI, CLI, or AI Prompts
100%
Pure BlatUI + Tailwind v4
0 Lock-In
Runs as Pure Laravel
1-Click
Flutter Mobile Export
Generation Superpowers

Four Ways to Build. Infinite Velocity.

Choose the workflow that fits your team. Visual drag-and-drop studio for architects, lightning CLI commands for developers, autonomous prompt generation for AI-native teams, or 1-click reverse-engineering for legacy monoliths.

🖥️

Visual Studio UI Web GUI

Interactive Blueprint Studio & Schema Wizard. Design multi-table aggregates, field types, validations, and parent-child entity trees with live directory previews.

  • ✓ High-density Statamic-style field grid
  • ✓ Aggregate root child entity manager
  • ✓ Real-time LaraSlice directory tree
Route: /laraslice/wizard
⚡

Developer CLI Artisan

One artisan command generates complete vertical slice architectures in under a second — including models, DTOs, controllers, routes, views, and migrations.

  • ✓ slice:make <Name> --workflow
  • ✓ blueprint:apply <file.yaml>
  • ✓ slice:make <Name> --flutter
php artisan slice:make Order
🤖

Autonomous AI Engine AI-Native

Natural language to production slices. LaraSlice provides Antigravity & Cursor skills that generate typed schemas directly from specs and user stories.

  • ✓ Jev System One typed decision engine
  • ✓ LaraSlice Skill prompt integration
  • ✓ Autonomous test and schema generation
"Create Order slice with Stripe..."
🚀

Legacy Porting Engine Reverse-Eng

Analyze legacy monolithic Laravel apps. Auto-detect aggregate roots, classify flat tables into bounded domains, and migrate data with dual mode options.

  • ✓ --mode=system-base (seeders, 0 blank selects)
  • ✓ --mode=full-data (records + storage copy)
  • ✓ Visual Studio Table-to-Slice Mapping modal
php artisan slice:port <path>
laraslice-terminal
$ php artisan slice:make Order --workflow --field=order_number:string --field=total:decimal
⚡ Scaffolding Vertical Slice: Order...
✓ Created Slice Manifest: app/Slices/Orders/slice.json
✓ Created Contracts (DTOs): OrderFormObject, OrderListingObject, OrderFilter
✓ Created Model & Migration: Order.php, create_orders_table.php
✓ Created Data Service: OrderSliceService.php (with CRUD lifecycle hooks)
✓ Created Controllers & Routes: OrderWebController, OrderApiController
✓ Created BlatUI Views: index.blade.php, form.blade.php
🎉 Slice [Order] generated successfully! Run 'php artisan migrate'.
Architectural Paradigm

Monolith Hell vs. Vertical Slice Clarity

In traditional layered Laravel, a single feature scatters code across 10 folders. LaraSlice groups all cohesive business logic into one autonomous bounded context.

❌ Traditional Layered Laravel (Scattered) Coupled & Fragile
app/Http/Controllers/OrderController.php
app/Http/Requests/StoreOrderRequest.php
app/Models/Order.php
app/Models/OrderItem.php
app/Services/OrderService.php
database/migrations/2026_create_orders_table.php
resources/views/orders/index.blade.php
resources/views/orders/create.blade.php
routes/web.php (contains 100+ random routes)

⚠️ Changing one field requires editing 8 different folders. Deleting a feature leaves orphaned migrations, routes, and views behind.

✅ LaraSlice Vertical Slice (Bounded Context) 100% Encapsulated
app/Slices/Orders/
├── slice.json (Declarative Manifest)
├── Contracts/ (Typed DTOs - Form, Listing, Filter)
├── Models/ (Order.php & OrderItem.php)
├── Services/ (OrderSliceService.php lifecycle hooks)
├── Http/ (OrderWebController & OrderApiController)
├── Resources/views/ (Pure BlatUI Blade templates)
└── Routes/ (web.php & api.php self-registered)

💎 Everything about the feature lives in one directory. Slices can be tested in total isolation, published as packages, or safely deleted in 1 click.

Code Standard

Anatomy of a LaraSlice

Explore the clean, typed PHP and Blade code generated by the engine. Zero magic, zero bloat — just pure, scalable architectural standards.

// app/Slices/Orders/slice.json
{
    "name": "Orders",
    "domain": "Shop",
    "version": "1.0.0",
    "root_table": "orders",
    "aggregate_children": ["order_items", "order_shipments"],
    "capabilities": ["view", "create", "edit", "delete", "export"],
    "auditable": true,
    "workflow": {
        "states": ["draft", "pending", "completed", "cancelled"]
    }
}
// app/Slices/Orders/Contracts/OrderFormObject.php
namespace App\Slices\Orders\Contracts;

readonly class OrderFormObject
{
    public function __construct(
        public string $orderNumber,
        public int $customerId,
        public float $totalAmount,
        public string $status = 'draft',
        public array $items = [],
    ) {}

    public static function fromRequest(Request $request): self
    {
        return new self(
            orderNumber: $request->validated('order_number'),
            customerId: $request->validated('customer_id'),
            totalAmount: (float) $request->validated('total_amount'),
            status: $request->validated('status', 'draft'),
            items: $request->validated('items', []),
        );
    }
}
// app/Slices/Orders/Services/OrderSliceService.php
namespace App\Slices\Orders\Services;

use LaraSlice\Core\Base\BaseSliceService;
use LaraSlice\Core\Audit\Traits\AuditableSlice;

class OrderSliceService extends BaseSliceService
{
    use AuditableSlice;

    public function afterCreated(Model $order, array $data): void
    {
        // Automated audit trail, notification dispatch, and child items sync
        $this->syncChildEntities($order, 'items', $data['items'] ?? []);
        $this->logAudit('order.created', $order);
    }
}
{{-- app/Slices/Orders/Resources/views/index.blade.php --}}
@extends('layouts.app')

@section('content')
<div class="space-y-6">
    <x-ui.table :items="$orders">
        <x-ui.table-column label="Order #" field="order_number" />
        <x-ui.table-column label="Customer" field="customer.name" />
        <x-ui.table-column label="Status">
            <x-ui.badge :variant="$item->status === 'completed' ? 'success' : 'outline'">
                @{{ $item->status }}
            </x-ui.badge>
        </x-ui.table-column>
        <x-ui.table-column label="Total" field="total_amount" />
    </x-ui.table>
</div>
@endsection
Architectural Foundation

The 3-Layer Packaging Model (ADR-001)

How LaraSlice guarantees zero broken upgrades. Customize core slices in your project without fighting Composer updates.

Layer 1: Engine

vendor/hereafter/laraslice

The core runtime engine: base classes, audit logging, blueprint parsers, discovery manager, and CLI commands. Updated cleanly via Composer without touching project business logic.

Layer 2: Starter Slices

app/Slices/ (Project Space)

Users, Roles, Auth, and Settings ship in app/Slices/. When you add CNIC, phone, or custom relationships, you commit them directly to your Git repository. Safe from Composer overwrites forever.

Layer 3: Community Packages

Packaged Bounded Contexts

Reusable vertical slices (Shop, Helpdesk, Billing). Customized cleanly via php artisan slice:publish or decoupled DTO event listeners.

Team Guidance

Developer Guide & Architecture FAQ

Answers to the most critical architectural questions for your engineering team.

Our Purpose & Collective

Engineered with Purpose. Scaled with Impact.

LaraSlice is built upon a visionary foundation of engineering excellence, compassionate innovation, and strategic digital reach.

Creator & Lead Architect hereaftersol.com →
Hereafter Solutions (H. Sol)

"Sowing Seeds of Innovation, Harvesting Compassion: Bridging Today’s Technology with Tomorrow’s Generosity."

Inspired by the prophetic 1/3 Hadith model (Sahih Muslim 7473), Hereafter Solutions reinvests one-third of its yield into open-source developer tooling like LaraSlice, and one-third to Sadqah-e-Jariyah as a Service (SJaaS) to empower startups worldwide.

Philosophy & Social Collective Visit H. Sol →
Official Digital Marketing Partner brandup247.com →
BrandUp

Accelerating High-Impact Brand Growth, Performance Marketing & Creative Reach.

BrandUp drives strategic market adoption, audience acquisition, and creative digital storytelling for modern tech ecosystems and enterprises across the globe.

Growth Strategy & Marketing Visit BrandUp →