Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Acorn Laravel Package

roots/acorn

View on GitHub
Deep Wiki
Context7

Integrate Laravel functionality into WordPress projects

Frequently asked questions about Acorn
Can I use Acorn to replace WordPress templates with Laravel Blade templates?
Yes, Acorn replaces WordPress PHP templates with Blade templates, enabling reusable components, layouts, and Laravel’s view layer. You’ll need to configure Acorn’s `template_include` filter to route requests through Laravel’s view resolver. Start with the [template rendering docs](https://roots.io/acorn/docs/templates/).
How do I install Acorn in a non-Bedrock WordPress project?
Acorn is optimized for Bedrock, but you can adapt it to custom setups by manually configuring paths in `composer.json` (e.g., `extra.acorn`) and ensuring WordPress’s `wp-content` location is correctly mapped. Check the [installation guide](https://roots.io/acorn/docs/installation/) for non-Bedrock adjustments, including autoloading and bootstrap hooks.
Does Acorn support WooCommerce or Advanced Custom Fields (ACF) integrations?
Yes, Acorn includes community packages like `roots/acorn-woocommerce` and `roots/acorn-acf` for seamless integration. These packages bridge Laravel’s Eloquent with WooCommerce products or ACF data. Review the [available packages](https://roots.io/acorn/docs/available-packages/) for compatibility and setup instructions.
What Laravel versions does Acorn support, and how do I check compatibility?
Acorn officially supports Laravel 13.x and requires PHP 8.3+. Verify compatibility by checking the [Laravel version badge](https://github.com/roots/acorn) and your `composer.json` constraints. For Laravel 14+, monitor the [Acorn roadmap](https://github.com/roots/acorn/issues) for updates.
Will Acorn work on shared hosting with PHP restrictions (e.g., open_basedir)?
Shared hosting may limit Acorn’s functionality due to restrictions like `open_basedir` or disabled PHP extensions (e.g., `pdo_mysql`). Test early with `ACORN_DEBUG=true` and check the [hosting constraints issue](https://github.com/roots/acorn/issues/512) for workarounds. Consider VPS hosting if you need full Laravel features.
How do I handle WordPress hooks (e.g., `template_include`) alongside Laravel middleware?
Acorn hooks into WordPress’s `wp_loaded` and `shutdown` events to avoid conflicts. Laravel middleware runs *after* WordPress filters like `template_include`, so late-binding issues are rare. Use `Application::configure()` to isolate components and debug with `ACORN_DEBUG=true` if hooks behave unexpectedly.
Can I use Eloquent ORM with WordPress’s wpdb, or do I need a separate database?
Acorn supports both shared and separate databases. Configure `config/database.php` to use WordPress’s `wpdb` for Eloquent or set up a dedicated Laravel database. For multisite, explicitly isolate schemas to avoid conflicts (see [#514](https://github.com/roots/acorn/issues/514)).
Are there performance overheads from running both WordPress and Laravel?
Yes, dual bootstrapping can introduce latency. Mitigate this by lazy-loading Laravel components (e.g., `Cache::shouldUseDatabase()`) and profiling with Xdebug. Acorn’s [performance tips](https://roots.io/acorn/docs/performance/) recommend disabling unused Laravel services and optimizing autoloading.
How do I run Artisan commands (e.g., `migrate`) in a WordPress environment?
Artisan commands integrate with WP-CLI via Acorn’s `wp acorn` namespace. Register commands in `routes/console.php` and run them with `wp acorn [command]`. For CI/CD, ensure your pipeline supports both WordPress (e.g., Deployer) and Laravel (e.g., Envoyer) workflows.
What are the alternatives to Acorn for using Laravel with WordPress?
Alternatives include decoupling WordPress and Laravel as microservices (e.g., WordPress as a headless CMS with Laravel as an API) or using plugins like **WP Laravel Bridge**, which offers lighter integration. Acorn is unique for its deep Laravel component integration (Blade, Eloquent, etc.) within WordPress’s core.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor
spatie/laravel-javascript-views