Installation
What is Acorn?
Acorn is a way to use Laravel components inside of WordPress.
Why use Acorn?
Acorn brings elements of the Laravel ecosystem to any WordPress plugin or theme.
To put it simply, Acorn provides a way to gracefully load a Laravel application container inside of WordPress while respecting the WordPress lifecycle and template hierarchy.
This means you get access to Laravel's artisan commands through the use of wp acorn
. You can utilize Blade templates. You gain access to third-party packages built specifically for Acorn. And we provide some first-party components as well, such as view composers and assets management.
Installing Acorn with Composer
We recommend that you install Acorn on your WordPress install managed by Composer, such as with Bedrock:
$ composer require roots/acorn
We also recommend adding Acorn's postAutoloadDump
function to Composer's post-autoload-dump
event in the scripts
section of composer.json
:
"scripts": {
//...
"post-autoload-dump": [
"Roots\\Acorn\\ComposerScripts::postAutoloadDump"
]
}
If you don't use Bedrock and you are using a Sage-based theme, you can install Acorn with Composer from your theme directory.
Server requirements
Acorn's server requirements are minimal, and mostly come from WordPress and Laravel 8's requirements.
- PHP >=8.0
- WordPress >= 5.4
- BCMath PHP Extension
- Ctype PHP Extension
- Fileinfo PHP Extension
- JSON PHP Extension
- Mbstring PHP Extension
- Tokenizer PHP Extension
- XML PHP Extension
Contributors
Last updated
Support Roots
Help us continue to build and maintain our open source projects. We’re a small team of independent developers and every little bit helps.
Sponsor Roots on GitHub