Laravel I Made a Huge Mistake Last year I wrote three different articles. And I have to admit something… Repositories After reading Fowler's "Patterns of Enterprise Application Architecture", I found that I royally messed things up. Repositories actually
AJAX Clean Transformed APIs In the past, when working with Javascript libraries that required diffrent JSON formatting, I have base models that extended Eloqent and changed the toArray function. It was super hacky and required a ton
Code Pivot Tables vs Pivot Models Lately, I have been working on multiple projects that have to deal with Polymorphic relationships, Many-To-Many, relationships, and the occasional Polymorphic Many-To-Many relationship. In working with these, a few
Code Eloquent Connections - Making the World Go Round In yesterday's article, we looked at how Eloquent models boot up and how the constructor works. However, you may have been scratching your head when you saw that this massively powerful ORM
Code Per Your Request - Starting Eloquent There is a lot going on with Laravel's Eloquent ORM, but to start things off in this series, we will actually start things off and look at how Eloquent Models boot up
Code Eloquent Expertise Preview Eloquent ORM is probably one of features that draws the most users to Laravel. However, I find that after a bit of working with Laravel, many users don't quite get what is
Code The Repository Pattern in Action Two weeks ago, I discussed Two Design Patterns That Will Make Your Applications Better. Since then, there has been high demand for a demonstration of the Repository Pattern in action. Today, we'll
Code Creating an Installer Script For Your Package In Laravel, one of the big questions is how best install packages. Traditionally, we would create a nasty bit of readme that included a script that looks like this: php artisan config:publish
Code Laravel Package Database Flexibility - Eloquent Models As I begin to create more full featured Laravel packages, I find that I want to offer the ability for users to specify different database credentials for my package than the ones used