All news

PHPAML 1.7: a new foundation for declarative PHP applications

A clearer architecture connecting CLI, Framework, AML View, Engine and Data—designed for real applications and explicit package boundaries.

PHPAML 1.7 marks a turning point: the project is no longer only a command-line tool for structuring PHP applications. It is becoming a coherent platform for building, rendering, persisting and deploying modern PHP products without hiding the language behind another syntax.

A faster first five minutes

The new project flow focuses on a predictable result. Developers can create a structured application, an API, or a declarative AML View project, start the local server, and immediately understand where pages, controllers, models, routes, styles and assets belong.

phpaml — zsh
aml create-view-app my-project
cd my-project
aml serve

The local server starts on port 8910 by default and selects the next available port when necessary. Generated View applications use a clear src structure with views, controllers and models, while public remains reserved for the entry point and directly accessible files.

AML View becomes a real frontend layer

AML View keeps PHP at the center while offering declarative components, reactive state, computed properties and effects. A component remains a PHP class, and its interface is expressed with readable elements instead of mixed PHP and HTML.

phpaml — zsh
final class Counter extends Page
{
    #[State]
    public int $count = 0;

    public function body(): View
    {
        return VStack(
            Heading('AML View')->size(42)->bold(),
            Text("Current value: {$this->count}"),
            Button('Add one')->onClick(fn () => $this->count++)
        )
        ->gap(16)
        ->padding(40);
    }
}

The server produces the initial document. AML Engine then handles interactions, state updates, effects and client-side navigation without requiring a complete page reload for every click.

Engine, View and Data stay separable

The platform is designed as a set of focused packages. The CLI creates, serves, builds and deploys projects. Framework provides the HTTP foundation. View describes interfaces. Engine powers browser reactivity. Data offers typed persistence for SQL and MongoDB. Applications can adopt the pieces they need without turning every dependency into a mandatory layer.

This separation is important for long-term stability. Each public package can document its own contract, run its own tests and evolve with explicit compatibility rules.

Typed persistence with PHPAML Data

PHPAML Data brings an Entity Framework-inspired workflow to PHP while preserving explicit models and query intent. SQL databases and MongoDB share familiar concepts for finding, filtering, inserting, updating and removing entities. MongoDB identifiers, transactions and transport behavior now have dedicated contracts and integration tests.

phpaml — zsh
$movies = $database->set(Movie::class);

$recent = $movies
    ->where('year', '>=', 2024)
    ->orderBy('rating', 'desc')
    ->all();

The goal is not to erase the database. It is to reduce repetitive plumbing while keeping identity, transactions and generated queries understandable.

Builds and deployments that respect the project

The deployment workflow now works from the build manifest instead of maintaining unrelated lists of folders. It understands both historical app-based projects and the newer src-based organization. Integrity checks protect build archives, and incremental deployment can transfer only added or modified files while removing obsolete files owned by the previous release.

What this beta proves

PHPAML 1.7 is still a beta, and that label matters. It gives the project room to strengthen package boundaries, browser tests, compatibility tracking and production deployment before promising a stable API. At the same time, the current release is complete enough to build real demonstrations: a book reader, an AI chess tutor, a movie API and the official PHPAML website.

In summary

PHPAML 1.7 provides a clearer project structure, a declarative PHP frontend, a client runtime, typed data access and a more reliable deployment pipeline. The next work is deliberately focused: stabilize contracts, deepen documentation, expand reproducible tests and learn from real applications built by the community.