Skip to content
Acorn
v4.3.0

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/bus
  • illuminate/cache
  • illuminate/collections
  • illuminate/conditionable
  • illuminate/config
  • illuminate/console
  • illuminate/container
  • illuminate/contracts
  • illuminate/database
  • illuminate/encryption
  • illuminate/events
  • illuminate/filesystem
  • illuminate/hashing
  • illuminate/http
  • illuminate/log
  • illuminate/macroable
  • illuminate/pipeline
  • illuminate/queue
  • illuminate/routing
  • illuminate/session
  • illuminate/support
  • illuminate/validation
  • illuminate/view
  • 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]
    
    about                Display basic information about your application
    clear-compiled       Remove the compiled class file
    completion           Dump the shell completion script
    db                   Start a new database CLI session
    env                  Display the current framework environment
    help                 Display help for a command
    list                 List commands
    migrate              Run the database migrations
    optimize             Cache the framework bootstrap files
    test                 Run the application tests
    
    acorn:init           Initializes required paths in the base directory.
    
    cache:clear          Flush the application cache
    cache:forget         Remove an item from the cache
    
    config:cache         Create a cache file for faster configuration loading
    config:clear         Remove the configuration cache file
    
    db:seed              Seed the database with records
    db:wipe              Drop all tables, views, and types
    
    key:generate         Set the application key
    
    make:command         Create a new Artisan command
    make:component       Create a new view component class
    make:composer        Create a new view composer class
    make:controller      Create a new controller class
    make:middleware      Create a new middleware class
    make:migration       Create a new migration file
    make:provider        Create a new service provider class
    
    migrate:fresh        Drop all tables and re-run all migrations
    migrate:install      Create the migration repository
    migrate:refresh      Reset and re-run all migrations
    migrate:reset        Rollback all database migrations
    migrate:rollback     Rollback the last database migration
    migrate:status       Show the status of each migration
    
    optimize:clear       Remove the cached bootstrap files
    
    package:discover     Rebuild the cached package manifest
    
    route:cache          Create a route cache file for faster route registration
    route:clear          Remove the route cache file
    route:list           List all registered routes
    
    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?