The 12 Factor PHP App – Part 3

2018-12-24 19.54.37

This is Part 3 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 development guidelines specified in the 12 Factor App manifesto and examines their relevance within the context of PHP applications. In this Part […]

Read More Comments Off on The 12 Factor PHP App – Part 3

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!). […]

Mocking the Filesystem during BDD with Behat and PHPSpec

I was recently reading the excellent tutorial by Peter Suhm which describes a possible behaviour driven development workflow with Behat and PHPSpec. While I think he illustrates the workflow in a coherent way and manages to shed some light on why emergent design via BDD is a useful thing, one particular part of the tutorial didn’t seem […]

Read More Comments Off on Mocking the Filesystem during BDD with Behat and PHPSpec

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 […]