PyroCMS: Naked and Unafraid

Brennon Loveless Guides


A little while ago I was beginning a new project. This project was not website but an application through and through. I didn't need pages. I didn't need posts. I didn't need a file manager. I didn't need a lot of what Pyro offers out of the box. So, I thought, I’ll use laravel by itself. Since I wasn’t building a website, I thought, I didn't need a CMS.

I absolutely love Laravel, but I love Pyro on top of Laravel even more!

To kick things off let me first describe the process I went through with Laravel.

Please don’t read this as an negative remark on Laravel.

Authentication

First I had to build a login system. Not a huge deal, but something that needed to happen. I figured I probably just needed simple authentication.

Theming

Next I started building the theme in blade. Now, there is nothing wrong with blade. It's just that I absolutely love twig! Once again not a huge deal. But the organization and streamlined workflow of Pyro's theme addons was definitely missed.

Business Logic

Then I started to build the addons for the system. And addons are something that I have grown to love in Pyro. They keep your project organized and focused.

To get started I opened my terminal and fired off php artisan make:addon ... wait that's a Pyro.. Bah, ok. Onward.

Frontend Tech

Next I started setting up gulp to process and watch my SCSS changes. I can never remember the exact process to set this up so a quick trip to Google and back to help get this setup was needed.

Build

Now, I'm ready to start really building. I have the bare essentials to get started now!

So I started creating controllers, models, and views for the application. Just some simple standard things. No interfaces or repositories that were encouraged in Pyro.. But, it was OK.

As far as I know without adding additional Service Providers you can't use a hierarchal layout which is the default that is encouraged in Pyro. But I pressed on and kept building.

After a few weeks, around 30 hours of building with Laravel, I was having some mad cravings for the niceties that I've become used to when developing in Pyro.

Stripping Pyro Naked

I decided to do a quick experiment. I wondered, how does Pyro perform as a platform, instead of a CMS?

Here's how I started:

  1. First I created a new Pyro project.
  2. I removed all the modules and plugins from the composer.json file but for a few fundamentals. The Users Module, Settings Module, and the Helper Plugin was all I left (oh, and the Installer module for sake of installing).
  3. Installed

After a successful install, I began working on the application just as I had before on Laravel. Only this time, instead of starting from square one I started from what felt like square one hundred!

I realized that everything I mentioned in the list above has already been completed in Pyro and then some. As well as some things that I would need but not encountered yet like form builders, field types, themes, and a UI system.

Instead of setting up gulp I was able to just use SCSS and LESS without a second thought. I didn't need gulp or anything else, I just started building.

Instead of building a simple auth control or including a random package I had a full user, role, permission management, authentication, and authorization system ready to go.

Instead of simply organizing my services in namespaces I was able to leverage Pyro's addons. I could now use Streams, the normalized database management system in Pyro's core engine.

I could use hierarchal twig views and layouts. Models were decorated automatically for my views. And I actually had a powerful presenter layer along with convenient plugins to access what were now stream entries in my application.

Building in PyroCMS is a dream! But I had no idea how powerful Pyro was as a platform. It was absolutely amazing!

So 15 hours later and I had reproduced everything I had done in Laravel but using Pyro instead. I've never looked back!

Laravel + Pyro = Synergy

I think a very important principle in PyroCMS is to be synergistic with Laravel. I absolutely love Laravel, but I love Pyro on top of Laravel even more! Pyro doesn't hide anything that Laravel can do, but adds some really amazing things to it.

- Brennon Loveless

Find @bloveless in the PyroCMS Slack Team