Laravel and WordPress together with Corcel

Imagine you using WordPress with Laravel or any PHP framework? Corcel does the job for you!

Developing web applications has to be fun, and fast. Of course each application has its own requirements and its lifecycle.

WordPress is a powerful CMS written in PHP, that allows you to create and produce fast, very fast. Otherwise, it does not followed the recent PHP changes and conventions, but you can balance this, using it with your framework of choice, including Laravel.

Corcel

I think the WordPress administration panel is amazing. It has a bunch of plugins that allow you to include fields, post types, images, crops and more, very fast. The best is: that works wonderfully!

That's why Corcel was developed, to allow you to get data from WordPress databases with easy. What you need? Just your PHP application skeleton (Laravel or another framework), a WordPress installation and the Corcel package installed (Composer).

So can I use MVC with WordPress? Yes!

You can have your application controllers, models, views, and continuing to work with WordPress. Corcel brings you a model collection to retrieve Posts, Pages, Menus, etc. You can even have different databases connections, one for your Laravel app and another just for Wordpress.

And now start to get what you need from the WordPress database:

Post Type and Custom Fields

Do you use Advanced Custom Fields (ACF)? You can get all the custom fields too:

You can create custom models related to custom post types:

There are much more features you can check directly in the GitHub repo. You can use Corcel with any PHP framework, even micro frameworks like Slim, Silex, etc. This allows you to get all WordPress administration panel data and gives you the opportunity to organize your project using custom routes, controllers, models and views.

Give Corcel a try, suggest new features and contribute :-) You're welcome!

Show your support

Clapping shows how much you appreciated Junior Grossi’s story.