---
title: "framework — Getting Started"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.middag.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# framework — Getting Started

# Getting Started with framework

Requires PHP `^8.3` (8.3, 8.4 and 8.5 are supported; see [Platform](/libraries/reference/platform)). Install via Composer:

```bash
composer require middag-io/framework
```

A controller that loads your domain and renders an Inertia page — attribute routing, a domain service injected by the container, no host API in sight:

```php
use Middag\Framework\Http\Controller\AbstractController;
use Middag\Framework\Http\Inertia\InertiaAdapter;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;

final class CourseController extends AbstractController
{
#[Route('/courses', name: 'courses')]
public function index(CourseCatalog $catalog): Response
{
    // CourseCatalog is your own domain service, injected by the container.
    return InertiaAdapter::render('Courses/Index', [
        'courses' => $catalog->published(),
    ]);
}
}
```

The same controller runs standalone, inside Moodle, or inside WordPress, by swapping the adapter.

## Where it runs

| Target | How |
|--------|-----|
| **Standalone** | Implement `BootstrapInterface`, build the container with `ContainerFactory::build()`, and serve through `StandaloneKernel`. |
| **Moodle** | The OSS `middag-io/moodle` adapter (`MoodleBootstrap` plus the bridge contracts). |
| **WordPress** | The OSS `middag-io/wordpress` adapter (in build-out). |

## Next

- [Overview](/framework/explanation/overview/) — the OSS × MIDDAG boundary and licensing model.
- [Architecture](/framework/explanation/architecture/) — the four pillars, concern-first layout, and bridge contracts.
- [Bootstrap](/framework/explanation/bootstrap-lifecycle/) — boot phases and the concrete boot flow.

Source: https://docs.middag.dev/framework/tutorials/getting-started/index.mdx
