Mastering Form Validation in Laravel 5

Laravel developers have always had a nice validation class out of the box, but unfortunately we have never had a standard way of using it. Some people prefer doing validation in controllers, others do it in models and I, as many others, preferred to do it in a separate validation layer. Of course, all of these methods worked […]

The 12 Factor PHP App – Part 2

This is Part 2 of a 3 part series: Part 1: Codebase, Dependencies, Configuration and Backing Services. Part 2: Build Release Run, Processes, Port Binding and Concurrency. Part 3: Disposability, Dev/prod parity, Logs, Admin Processes. This series takes the precepts specified in the 12 Factor App manifesto and examines their relevance within the context of PHP applications. It also aims […]

PHP Dependency Injection with Laravel 5

Dependency Injection in PHP with Laravel 5

Laravel has a great dependency injection mechanism and in the newest version this mechanism was improved even more. In this article we will review the way dependency injection works, what’s new in the 5th version and why it is amazing. Constructor injection First of all, let’s see an example of a “classical” constructor dependecy injection. […]

Why Use the Repository Pattern?

The repository pattern has recently taken on a life of its own in the echo chamber of PHP architecture and development blogs. It seems that just about every PHP developer with a blog has ingested the proverbial flavoured drink mix and written about how the repository pattern can used in a MVC-based web application (this one included!). […]

Setting the Environment Name in Laravel

One of the most important things for you to consider when planning the deployment of your application into production is how to handle detecting the “environment.” The environment name is a string identifier that is unique for each deployment environment. Typically, descriptive names such as “production,” “local,” “staging,” and “testing” are used, although you can […]

The 12 Factor PHP App – Part 1

This is Part 1 of a 3 part series: Part 1: Codebase, Dependencies, Configuration and Backing Services. Part 2: Build Release Run, Processes, Port Binding and Concurrency. Part 3: Disposability, Dev/prod parity, Logs, Admin Processes. In this series we’re going to look at ways of building scalable, secure and maintainable web applications using the 12 Factor […]