Skip to main content
Open source from Alley

WordPress, with the structure of a framework.Fluent. Testable. Still WordPress.

Mantle is a Laravel-inspired framework for building large, robust websites and applications with WordPress.

composer require alleyinteractive/mantle-framework
Get started
// Respond to WordPress requests with a route.
Route::get('/post/{post}', function (Post $post) {
return view('post')->with('post', $post);
});

Route::post('/upload/', function (Request $request) {
$id = $request->file('image')->store_as_attachment();

// Generate thumbnails in the background.
Generate_Thumbnails::dispatch($id);

return response()->json([ 'attachment_id' => $id ], 201);
});

Route::rest_api('namespace/v1', '/route-to-use', function () {
return [ ... ];
});
Built onWordPressComposerSymfony RoutingBladePHPUnitPest

Everything an application needs. WordPress core underneath.

Underneath the hood, Mantle uses WordPress core functions and APIs. On top, you get the fluent toolkit you’d expect from Laravel.

Testing

An independent test framework for WordPress.

A drop-in replacement for the WordPress core test suite that runs faster and gives you IDE-friendly, fluent assertions. PHPUnit out of the box, with Pest support.

tests/Feature/UploadTest.php
class UploadTest extends TestCase {
public function test_upload_file(): void {
$this->acting_as('author');

$post = static::factory()->post->create_and_get();

$this->get($post)
->assertOk()
->assertSee($post->post_title);

$this->post('/upload', [ 'image' => [ ... ] ])
->assertStatus(201)
->assertJsonPathExists('attachment_id');

$this->assertJobQueued(Generate_Thumbnails::class);
}
}

Not on Mantle? Use Testkit.

Bring the Mantle Testing Framework to an existing plugin, theme or wp-content project with no refactoring.

composer require --dev mantle-framework/testkit
Read the Testkit guide →
01

Simplicity first

Enterprise-level WordPress development is possible and should have a simple, delightful syntax.

02

Inspired by Laravel

The flexibility of the Laravel framework inside WordPress, with a baked-in WordPress integration.

03

Readable for people and agents

Every page is available as Markdown, with llms.txt and llms-full.txt for AI tools.

Code should be fluent, testable and delightful to work with.