Skip to content
Acorn
v2.1.3

Acorn is a framework for integrating Laravel within WordPress

  • Use Laravel functionality in WordPress
  • Laravel Blade for WordPress
  • Compatibility with lots of the Laravel ecosystem

Use Laravel within WordPress

Acorn provides a way to gracefully load a Laravel application container inside of WordPress while respecting the WordPress lifecycle and template hierarchy.

Supported Laravel components

  • illuminate/cache
  • illuminate/config
  • illuminate/console
  • illuminate/container
  • illuminate/contracts
  • illuminate/events
  • illuminate/filesystem
  • illuminate/http
  • illuminate/log
  • illuminate/support
  • illuminate/view
  • Experimental & in-progress

  • illuminate/database
  • illuminate/routing
  • Laravel’s Artisan commands in WP-CLI

    Acorn includes WP-CLI commands that provide a familiar Artisan-like command line interface for WordPress. Create components, service providers, clear the view cache, and more.

    $ wp acorn
    
    USAGE: wp acorn [command] [options] [arguments]
    
    clear-compiled   Remove the compiled class file
    completion       Dump the shell completion script
    env              Display the current framework environment
    help             Display help for a command
    list             List commands
    optimize         Cache the framework bootstrap files
    
    acorn:init       Initializes required paths in the base directory.
    
    config:cache     Create a cache file for faster configuration loading
    config:clear     Remove the configuration cache file
    
    make:command     Create a new Artisan command
    make:component   Create a new view component class
    make:composer    Create a new view composer class
    make:provider    Create a new service provider class
    
    optimize:clear   Remove the cached bootstrap files
    
    package:discover Rebuild the cached package manifest
    
    vendor:publish   Publish any publishable assets from vendor packages
    
    view:cache       Compile all of the application's Blade templates
    view:clear       Clear all compiled view files
    

    Harness the Laravel ecosystem

    There are countless useful Laravel packages that can be used in your WordPress themes and plugins thanks to Acorn.

    Sponsors

    Help support our open-source development efforts

    Subscribe for updates

    Join over 8,000 subscribers on our newsletter to get the latest Roots updates and tips on building better WordPress sites

    Looking for WordPress plugin recommendations, the newest modern WordPress projects, and general web development tips and articles?