October: Question: Can October be added to an existing Laravel installation?

Created on 29 Nov 2017  路  3Comments  路  Source: octobercms/october

Biggest thing for me is that I'd rather derive from the latest Laravel skeleton structure. Further to that, are there any guides for doing this?

Question

Most helpful comment

@atrauzzi What you're asking for is difficult by nature because a CMS works by being opinionated about things like code structure.

October's core assumptions are

  1. Custom business logic is encapsulated within individual plugins stored in the $pluginsDir.
  2. Each site has one theme that is stored in the $themesDir and is rendered using the Twig template engine and does not contain significant amounts of business logic

This doesn't play nice with dropping directly into an existing Laravel project because of Laravel's core assumption:

  1. Each site is purpose built and inoperable without every single component. I.e. every bit of a Laravel applications custom business logic is strewn throughout the App directory interspersed with default Laravel files for core functionality.
  2. Sites are rendered using the Blade template engine and everything is a view of some sort

The differences between these two very different core assumptions make it difficult to just drop October into an existing Laravel installation. Relatively speaking, it's not that difficult to "helicopter" everything out to a new October project, you just need to know how to work with October, things like the concept of plugins as self-contained modules.

I think it would be best to explain October as a Laravel application with five pieces working together:

  1. The October\Rain framework that extends the Laravel\Framework
  2. The October bootstrapper present in the directory structure of a base October project
  3. The three core modules (modules are like 眉ber plugins, although it's pretty much never necessary to create your own module since everything they do can be accomplished by plugins)
    a. The System module that bootstraps the concepts of plugins and modules
    b. The Backend module that controls the entire backend interface
    c. The CMS module that introduces themes and the overall October theme & static content structure
  4. Plugins, both single project purpose built and multi-project marketplace ones
  5. Themes, all purpose built (but sometimes based off of marketplace ones)

So, when someone asks for October to be "dropped into" an existing Laravel application, what they're asking for is quite large. That's not to say that it's difficult to get existing applications working with October, it's just that you have to do it with the knowledge of how October is structured.

Now, if you're only asking for very specific pieces of October to be dropped in, then that is a much more manageable question that would be easier to answer.

All 3 comments

Why do you want to? AFAIK there are no guides, but it might be a bigger pain than it's worth seeing as it's not officially supported.

Main reason would be if I've come upon a requirement for an older project to now incorporate a CMS. Even if October heavily customizes the base Laravel skeleton, in many projects, it's still likely less work to drop-in October than helicopter everything out to an October skeleton without causing pain.

Without implying that it has to be officially supported, is there any way to itemize what would be required? Either so that it's known, or so that it can be tracked for improvement?

I love the idea of a CMS that can also be a library, especially given that the Laravel (and PHP!) ecosystem really pride themselves on packages. Maybe even if it just means you only get the core data model and rendering flow? Seems like an angle that hasn't necessarily been considered by many if not all of the popular Laravel CMS options.

@atrauzzi What you're asking for is difficult by nature because a CMS works by being opinionated about things like code structure.

October's core assumptions are

  1. Custom business logic is encapsulated within individual plugins stored in the $pluginsDir.
  2. Each site has one theme that is stored in the $themesDir and is rendered using the Twig template engine and does not contain significant amounts of business logic

This doesn't play nice with dropping directly into an existing Laravel project because of Laravel's core assumption:

  1. Each site is purpose built and inoperable without every single component. I.e. every bit of a Laravel applications custom business logic is strewn throughout the App directory interspersed with default Laravel files for core functionality.
  2. Sites are rendered using the Blade template engine and everything is a view of some sort

The differences between these two very different core assumptions make it difficult to just drop October into an existing Laravel installation. Relatively speaking, it's not that difficult to "helicopter" everything out to a new October project, you just need to know how to work with October, things like the concept of plugins as self-contained modules.

I think it would be best to explain October as a Laravel application with five pieces working together:

  1. The October\Rain framework that extends the Laravel\Framework
  2. The October bootstrapper present in the directory structure of a base October project
  3. The three core modules (modules are like 眉ber plugins, although it's pretty much never necessary to create your own module since everything they do can be accomplished by plugins)
    a. The System module that bootstraps the concepts of plugins and modules
    b. The Backend module that controls the entire backend interface
    c. The CMS module that introduces themes and the overall October theme & static content structure
  4. Plugins, both single project purpose built and multi-project marketplace ones
  5. Themes, all purpose built (but sometimes based off of marketplace ones)

So, when someone asks for October to be "dropped into" an existing Laravel application, what they're asking for is quite large. That's not to say that it's difficult to get existing applications working with October, it's just that you have to do it with the knowledge of how October is structured.

Now, if you're only asking for very specific pieces of October to be dropped in, then that is a much more manageable question that would be easier to answer.

Was this page helpful?
0 / 5 - 0 ratings