Corcel has worked great for us, even in a production environment.
Our family's e-commerce business previously had a slow and bloated WooCommerce site, largely due to my skill issues. However, we were able to rescue the site by using Corcel, Laravel, Filament, and LunarPHP.
My wife still uses the WordPress admin interface as the main admin tool, while the public-facing website is rendered by Laravel, with data provided seamlessly through Corcel.
Oh, interesting. Can you provide more insights? Pitfalls?
I am in a very similar situation. Just it's not my families business. It's a friend e-commerce business that i supported & developed on the site for years. I wanted to move the product creation to a separate php application & sync via api. But those projects always explode.
How much time did you spend on this "migration"?
Is it a monolith? How does everything work together? What if you wanna leave the Wordpress DB schema behind at some point, would it be easy to "just" rewrite your backend models & DB schema?
After taking a quick look at your e-commerce site, you could simplify it further without compromising performance over personalization/technology stack if you have alternative options especially minimal codebase and CDN friendly.
Agreed. I've been doing freelance design/dev for small businesses for 15+ years and at first I would always choose the best current CMS available. Wordpress was always an option, but it was clunky and had a mixed reputation. Well, all those CMSs are gone and I had to migrate several sites. Wordpress offers one of the most important things to these small businesses: (relative) consistency and dependability.
I can very much see the benefit of decoupling the front and back ends for these cases, especially since in most cases nowadays the public facing pages are pre-rendered/cached anyway. Also, I love Laravel.
It circumvents the GPL unless you have a very unusual interpretation or have it putting GPL code into your database, with better performance and less complexity that the REST and GraphQL wrappers that are common ways to do headless WordPress.
Looks to me to be a bit more than that in the repo.
Not sure if this is a thing in Laravel yet but usually it's easy to generate ORM classes from an existing database. Symfony has it in their CLI tool, or had back in 2019 when I last used it.
I can see why people would do this with existing WordPress setups, but would there be any reason to consider it for a new build over a dedicated headless CMS (like Strapi or a bunch for PHP I don't know well enough to name) or headless CMS SAAS (like Prismic)?
We migrated from WordPress to Prismic several years ago, then migrated to Strapi a year ago, and it has been miserable.
We originally used Corcel with our Laravel installation, but somehow still found malware, so we immediately decommissioned the entire WordPress install and switched to Prismic. Prismic worked great and I regret switching to Strapi, but I felt the extensibility would be better (and latency reduced) if we self-hosted our headless CMS.
Managing Strapi is a full-time job, and their support for things like localization and their API are terrible. Don’t believe their marketing hype.
Yes. Every content manager and content writer knows and loves Wordpress. It's only developers that hate Wordpress. Corcel lets those content people use the tools they like, and lets developers build secure, performant, maintainable websites.
A direct database connection means almost all of your queries will work without any error handling. Using an API requires you to handle lost connection every time you make a request.
Direct database connections almost always are orders of magnitude faster, especially when joins are involved.
Can someone explain the sweet spot here? WP has a REST API. It has a GraphQL plugin. Whether you use those via BE or FE requests, the backend is already open to anything.
This is very cool! It always felt like PHP was behind in tooling - git-driven CI was challenging for WordPress (because the framework's plugins edit the project files and it is married to subversion), and serverless PHP was basically impossible until Laravel Vapor came along. Projects like this give me hope and excitement. I wish Corcel was around years ago when I had to write gross SQL string interpolation for various WordPress projects.
Agreed on PHP tooling. I'm surprised more hasn't been borrowed from other frameworks. Working in this space too on serverless wordpress+mariadb[0]. We have a lot of open source tooling on our roadmap to make this as complete as serverless for other languages.
From skimming the docs, this is more about WP database than WP itself. In other words, you could install WP to setup the DB and then kill the WP install if you liked.
1. It looks like it only works with that which would be provided by WP by default. For example, the link below is an extension for working with Woocommerce. Given that WP doesn't even need to exist (you only need the WP DB) then you could use whatever setup is compatible with Laravel. You could also have separate environments with WP and Laravel sharing a remote DB.
2. Both WP and Laravel would work as if the other didn't exist. They only share the DB.
[+] [-] dizaime|1 year ago|reply
Our family's e-commerce business previously had a slow and bloated WooCommerce site, largely due to my skill issues. However, we were able to rescue the site by using Corcel, Laravel, Filament, and LunarPHP.
My wife still uses the WordPress admin interface as the main admin tool, while the public-facing website is rendered by Laravel, with data provided seamlessly through Corcel.
[+] [-] n3storm|1 year ago|reply
[+] [-] endofreach|1 year ago|reply
I am in a very similar situation. Just it's not my families business. It's a friend e-commerce business that i supported & developed on the site for years. I wanted to move the product creation to a separate php application & sync via api. But those projects always explode.
How much time did you spend on this "migration"?
Is it a monolith? How does everything work together? What if you wanna leave the Wordpress DB schema behind at some point, would it be easy to "just" rewrite your backend models & DB schema?
[+] [-] todotask|1 year ago|reply
[+] [-] hu3|1 year ago|reply
Nifty tool for PHP projects that need to interface with Wordpress data.
With how large the Wordpress market is, this is probably desired by more teams than one could think of at a quick glance.
[+] [-] 3D30497420|1 year ago|reply
I can very much see the benefit of decoupling the front and back ends for these cases, especially since in most cases nowadays the public facing pages are pre-rendered/cached anyway. Also, I love Laravel.
[+] [-] benatkin|1 year ago|reply
[+] [-] cess11|1 year ago|reply
Not sure if this is a thing in Laravel yet but usually it's easy to generate ORM classes from an existing database. Symfony has it in their CLI tool, or had back in 2019 when I last used it.
[+] [-] crooked-v|1 year ago|reply
[+] [-] ianhawes|1 year ago|reply
We originally used Corcel with our Laravel installation, but somehow still found malware, so we immediately decommissioned the entire WordPress install and switched to Prismic. Prismic worked great and I regret switching to Strapi, but I felt the extensibility would be better (and latency reduced) if we self-hosted our headless CMS.
Managing Strapi is a full-time job, and their support for things like localization and their API are terrible. Don’t believe their marketing hype.
[+] [-] dotancohen|1 year ago|reply
[+] [-] woody311|1 year ago|reply
[+] [-] saltybytes|1 year ago|reply
[+] [-] kayodelycaon|1 year ago|reply
Direct database connections almost always are orders of magnitude faster, especially when joins are involved.
[+] [-] philipwhiuk|1 year ago|reply
(This is speaking as someone who just migrated a site TO WordPress because it was still better than the previous system...)
[+] [-] jonwinstanley|1 year ago|reply
[+] [-] ssnepenthe|1 year ago|reply
[+] [-] chiefalchemist|1 year ago|reply
[+] [-] jackconsidine|1 year ago|reply
[+] [-] djxfade|1 year ago|reply
[+] [-] devmor|1 year ago|reply
I've got production PHP Lambda runtimes that predate Laravel Vapor by 7 years...
[+] [-] rgbrenner|1 year ago|reply
0. https://www.agiler.io
[+] [-] ceejayoz|1 year ago|reply
[+] [-] aantix|1 year ago|reply
[+] [-] robmil|1 year ago|reply
[+] [-] moritzwarhier|1 year ago|reply
Is it derived from "coerce", because it can be pronounced like "core cell"? Or something else? Or just a made-up term? :)
Could imagine people being genuinely grateful for being able to plug another PHP application onto WordPress for the frontend, if this works well.
Great idea!
[+] [-] TCattd|1 year ago|reply
[+] [-] Onavo|1 year ago|reply
[+] [-] localfirst|1 year ago|reply
1. does it work with any wordpress plugin? can i piggy back off laravel + frankenphp to scale what used to be nightmarish with wordpress?
2. does the underlying CMS UI still work for WP? Or is it built separately?
[+] [-] gexla|1 year ago|reply
1. It looks like it only works with that which would be provided by WP by default. For example, the link below is an extension for working with Woocommerce. Given that WP doesn't even need to exist (you only need the WP DB) then you could use whatever setup is compatible with Laravel. You could also have separate environments with WP and Laravel sharing a remote DB.
2. Both WP and Laravel would work as if the other didn't exist. They only share the DB.
https://github.com/corcel/woocommerce
[+] [-] TheCapeGreek|1 year ago|reply
[+] [-] aussieguy1234|1 year ago|reply
Later, I used React to talk to the WordPress API, exposing the Customiser config as JSON, then getting React to render pages based of this.
[+] [-] hparadiz|1 year ago|reply
[+] [-] Implicated|1 year ago|reply
[+] [-] ulrischa|1 year ago|reply
[+] [-] benatkin|1 year ago|reply
Either are better than having to deal directly with WordPress, though.
[+] [-] tcfunk|1 year ago|reply