How to Integrate Propel 2 with Laravel 4.1.x

I was recently doing some prototyping with Laravel, the self-proclaimed “PHP Framework for Web Artisans”.  It seems to be gaining quite some traction within the framework community, and it boasts some cool features such as dependency injection via an Inversion of Control container and a groovy command-line interface called Artisan.  Even better, the framework documentation is clearly written, detailed enough to dig beneath surface level, and (most importantly) it works.

Laravel ships with its own home-brewed ORM called Eloquent (based on the Active Record pattern), but I wanted to see how easy or difficult it would be to integrate another popular ORM, Propel, into the framework.  This would be an important consideration if a project were already using Propel with another framework, but wanted to transition to Laravel without having to rewrite its data mappings.  I found a solid post online that outlined an integration for Laravel 4 and Propel 1.6, but Propel is now in version 2 so some steps were no longer accurate.  I ended up figuring my way around the integration, and wanted to share my notes in this post.

Continue reading…