Pollora emerges as an innovative framework designed to encapsulate WordPress within a Laravel application.
The Laravel framework initializes first, effectively managing front-end requests through its own router, controllers, and Blade templating engine, while simultaneously allowing the WordPress admin interface, database, and plugins to function seamlessly.
The framework presents an array of features:
- WordPress-aware Routing: Laravel utilizes conditional tags for routing, falling back on the template hierarchy as necessary.
- Attribute Registration: Declare post types, taxonomies, hooks, and REST routes as PHP attributes.
- Blade Themes and Blocks: Render Blade views alongside Vite assets and Gutenberg blocks using Blade syntax.
- Eloquent Models: Access WordPress data via Colt, a specialized fork of Corcel.
- Media Storage: Leverage any Laravel disk for media libraries, including S3 and R2 integrations.
- Agent Tooling: Access Pollora guidelines and MCP tools through the Laravel Boost framework.
#Operational Mechanics of Pollora Running WordPress
The framework employs Composer to install WordPress core intopublic/cms, loading it as Laravel initializes, thus utilizing the pre-configured Laravel settings and database connection.
Notably, WordPress retains its request parsing capabilities, ensuring that conditional tags like is_single() continue to function as expected, albeit with Laravel handling the rendering of the responses.
The admin dashboard remains accessible at/cms/wp-admin/, mirroring the standard functionality found on any traditional WordPress site.
With the tandem operation of both frameworks, each web request instantiates WordPress and its associated plugins. Updates to the WordPress core are managed via Composer, diverging from the conventional dashboard update method.
#Routing Leveraging WordPress Conditional Tags
Pollora introduces the methods Route::wp() and Route::wpMatch() into the routing ecosystem.
These methods correspond requests with WordPress conditional tags such as is_page() or is_single(), enabling usage by either the full function name or a brief alias such as page:
use App\Http\Controllers\FormController;use App\Models\Feature;use Illuminate\Support\Facades\Route; Route::wp('single', function () { return view('post');}); Route::wp('template', 'landing', function () { return view('page.landing', [ 'features' => Feature::all(), ]);}); Route::wpMatch(['GET', 'POST'], 'page', ['contact', ], [FormController::class, 'index']);A route is not mandated for every single page. In instances where requests do not align with any defined routes, Pollora resorts to the WordPress template hierarchy to render the corresponding Blade view, meaning that an “About” page would utilize page-about.blade.php if available, subsequently defaulting to page.blade.php.
#Post Types and Hooks as PHP Attributes
Rather than invoking register_post_type() within functions.php, one can declare a post type as a class. Pollora identifies this declaration, auto-generating the slug and labels based on the class nomenclature:
namespace App\Cms\PostTypes; use Pollora\Attributes\PostType;use Pollora\Attributes\PostType\HasArchive;use Pollora\Attributes\PostType\MenuIcon;use Pollora\Attributes\PostType\PubliclyQueryable;use Pollora\Attributes\PostType\Supports; #[PostType]#[PubliclyQueryable]#[HasArchive]#[Supports(['title', 'editor', 'thumbnail'])]#[MenuIcon()]class Event{}Actions and filters are similarly streamlined, allowing a method to respond to multiple hooks seamlessly:
namespace App\Cms\Hooks; use Pollora\Attributes\Action;use Pollora\Attributes\Filter; class ContentHooks{ #[Action('init', priority: 10)] #[Action(, priority: 15)] public function setup(): void { // ... } #[Filter('the_content', priority: 10)] public function filterContent(string $content): string { return str_replace('ugly', 'shiny', $content); }}Command-line tools such as pollora:make:post-type and pollora:make:action facilitate the generation of these classes automatically.
#Gutenberg Blocks Rendered via Blade
The command pollora:make:block scaffolds a new Gutenberg block, creating a block.json, JSX editor files, and a Blade template in one fell swoop:
php artisan pollora:make:block hero-banner --themeThe Blade template continuously renders the Gutenberg block upon each request, ensuring that modifications to the markup cascade across every page utilizing it.
The editor preview derives from the same template, while Pollora streamlines asset construction for the block utilizing Vite.
#Managing Media on Laravel Storage Disks
With Pollora, the WordPress media library can reside on any disk specified within config/filesystems.php. Simply define the disk in your setup, and direct Pollora to it within the .env configuration:
MEDIA_DISK=mediaMEDIA_URL=https://media.example.comWordPress continues to utilize its native upload functionalities, thereby ensuring that plugins such as ACF and WooCommerce operate without necessitating modifications.
For those unfamiliar with configuring S3 storage in Laravel, consult the documentation on utilizing AWS S3 for Laravel storage.
#Comparative Analysis
Prior endeavors sought to reconcile Laravel and WordPress using diverse methodologies, exemplified by frameworks such as Themosis and Corcel, which permit access to WordPress tables from a Laravel application. Pollora articulates its own comparison against Acorn, Sage, Radicle, and Corcel:
| Pollora | Acorn | Sage | Radicle | |
|---|---|---|---|---|
| Definition | A Laravel application encapsulating WordPress | A module integrating Laravel components within WordPress | A foundational WordPress theme | A WordPress foundation built on the Roots architecture |
| Initialization Sequence | Laravel precedes, with WordPress nested within | WordPress initializes first, subsequently booting Acorn from a theme or plugin | Loaded as a theme within WordPress | WordPress initializes first, in conjunction with Acorn |
| Post Types and Hooks | Employs PHP attributes | Involves theme or plugin code | Utilizes theme-based code | Configured in config/post-types.php |
| Licensing and Pricing | MIT, complimentary | MIT, complimentary | MIT, complimentary | One-time payment |
This comparative analysis recommends Sage for developing themes within a conventional WordPress installation, Acorn for integrating Laravel components into existing websites, and Corcel for Laravel applications that merely retrieve WordPress data.

Additionally, it highlights Pollora as an emerging project, contrasting its current usage with the more established status of Acorn and Sage.
#Installation Procedure
To initiate a new project, utilize Composer as follows:
composer create-project pollora/pollora my-projectThe installation documentation delineates the prerequisites, setup, Pollora CLI usage, and DDEV configuration details. For developers, the Nectar package adds Pollora guidelines and MCP tools within the Laravel Boost ecosystem.
Pollora falls under an MIT license. Further documentation can be accessed via pollora.dev, and the source code is hosted on the Pollora repository on GitHub.
Source link: Laravel-news.com.



