- What is corcel/woocommerce used for?
- corcel/woocommerce is a Laravel package that maps WooCommerce database tables to Eloquent-style models through the Corcel ORM. It lets you query products, orders, customers, and coupons from an existing WordPress/WooCommerce database directly inside a Laravel app, without bootstrapping WordPress. Typical uses are headless storefronts, internal dashboards, reporting tools, and gradual WordPress-to-Laravel migrations.
- How do I install corcel/woocommerce in a Laravel project?
- Install it with Composer alongside the Corcel core package, typically with composer require corcel/woocommerce. You then publish and adjust the package configuration so it can reach your WordPress database, including the table prefix. Because v6.0.0 is a major release aligned with Laravel 12 and Corcel v9, check the version constraints before installing into an existing app.
- Does corcel/woocommerce require WordPress to be installed or bootstrapped?
- No bootstrapped WordPress runtime is needed, but the package does read from an existing WordPress/WooCommerce database. Laravel connects to that database and queries the wp_posts, wp_postmeta, and related WooCommerce tables through Corcel models. That makes it a good fit for decoupled setups where WordPress remains the content and commerce backend while Laravel serves the front end or API.
- Which Laravel and PHP versions does corcel/woocommerce v6 support?
- v6.0.0 modernises the package for Laravel 12 and Corcel v9, which implies a PHP 8.2 or newer floor. Because it is a major bump, older Laravel majors are very likely dropped, so verify the exact support matrix in the package composer.json before upgrading. Teams still on Laravel 10 or pinned to Corcel 8 should stay on the previous package major until the framework upgrade is finished.
- How do I query WooCommerce orders and products in Laravel with Corcel?
- You use the package's order and product models like any Eloquent model, for example filtering orders by status or post status and then reading totals, statuses, addresses, and line items through the provided relationships and accessors. Class names and namespaces are documented in the package README, and model customization lets you extend them. Because the package reads WooCommerce's own schema, returned data mirrors what WooCommerce stores.
- Can I change the WordPress table prefix used by corcel/woocommerce?
- Yes. The package supports configurable table prefixes, which matters for installs that do not use the default wp_ prefix or that host several WordPress sites in one database. Set the prefix in the published configuration so Corcel resolves the correct tables. An incorrect prefix is a common cause of empty results or missing relationship errors.
- Is corcel/woocommerce safe to use in production?
- It is a library-level dependency with no runtime services of its own, so it adds no new infrastructure. The real production risk is data shape: assumptions about the WordPress schema, serialized postmeta, and plugin-managed fields such as ACF, not the package's own API. Validate against an anonymised snapshot of the real production database rather than fixtures before going live.
- How should I test a Laravel app that uses corcel/woocommerce?
- Run an explicit CI matrix rather than a single job, at minimum covering the previous major with Laravel 11 and Corcel 8 and v6.0.0 with Laravel 12 and Corcel 9, so you keep a tested rollback target. For behaviour, test against an anonymised copy of the production WordPress database, focusing on custom post types, taxonomies, postmeta reads and writes, and media URLs. Fixture-only unit tests tend to miss the schema and serialization quirks that actually break.
- How do I upgrade from corcel/woocommerce v5 to v6 and is v5 still maintained?
- v6.0.0 is a major release that moves to Laravel 12 and Corcel v9, so treat it as a coupled upgrade rather than an isolated Composer bump. Move Laravel, PHP, Corcel, and this package together on a branch, and check for configuration file, published asset, and renamed or removed API changes. Keep production pinned to the previous major and confirm the vendor's backport policy for v5.x before committing to a timeline.
- What are the alternatives to corcel/woocommerce for reading WooCommerce data in Laravel?
- Alternatives include calling the WooCommerce REST API with Laravel's HTTP client, using a dedicated WooCommerce API wrapper package, or hand-writing Eloquent models over the WordPress tables yourself. corcel/woocommerce is the pragmatic pick when you want direct database access with Eloquent-style models and already use Corcel for WordPress content. If you only need order data and can tolerate API latency, the REST route avoids coupling your app to WordPress schema changes.