# Installation

# What is Acorn?

Acorn is a way to use Laravel components inside of WordPress (opens new window).

# 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 for on-the-fly rendering of your Blade views. 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

Install Acorn on your WordPress install managed by Composer, such as with Bedrock (opens new window):

$ composer require roots/acorn

We also recommend adding Acorn's postAutoloadDump function to Composer's post-autoload-dump event in composer.json:

"post-autoload-dump": [
  "Roots\\Acorn\\ComposerScripts::postAutoloadDump"
]

# Installing Acorn as a plugin

Although not officially supported, the following options should work. Please file a bug report (opens new window) for future consideration if you run into issues.

# Server Requirements

Acorn's server requirements are minimal, and mostly come from WordPress and Laravel 8's requirements (opens new window).

  • PHP >=7.3 or >=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

Page authors:

Ben Word
Sponsor us on GitHub to help us grow 🌱