Demystifying Dependency Injection Containers

Video from Kai Sassnowski’s talk at Laracon EU 2019: The goal of this talk is to explain how dependency containers work by building our own. We start out by building the simplest DI container possible to demonstrate the underlying concept. Most people will be surprised about how little code this actually takes (3-4 effective lines …

PHP Performance Tip: Use fully-qualified function calls when working with namespaces

TIL: When working with namespaced files in PHP it’s a huge performance win when using fully-qualified function calls. ~ If you’re calling is_null in your code, PHP will first check for the function’s existence in the current namespace. If not found there, it will look for the function in the global namespace. This extra check …

Laravel 6 From Scratch Free Video Course

In this series, step by step, I’ll show you how to build web applications with Laravel 6. We’ll start with the basics and incrementally dig deeper and deeper, as we review real-life examples. Once complete, you should have all the tools you need. Let’s get to work! All 68 videos in this course, totalling 8:59:43 …

Convert between Symfony HttpFoundation Request / Response and Swoole Request / Response classes with swoole-http-message-bridge

Today I was implementing an HTTP Server using Swoole. At its core, the code looks just like the Swoole HTTP Server example: <?php $http = new \Swoole\HTTP\Server("127.0.0.1", 9501); $http->on('request', function (\Swoole\HTTP\Request $request, \Swoole\HTTP\Response $response) { // … $response->end(); }); $http->start(); In that same project I was also looking to use a package that evolves around …

Azure Functions Custom Handlers

Baller addition (in preview) to Azure Functions: Azure Functions offers first-class support for a limited number of languages. Now in preview, register custom handlers by providing a lightweight HTTP server in any desired language. Use this new capability to extend the language support for your applications, enabling the use of languages or language versions not …

Laraguard – Two Factor Authentication via TOTP for all your Users out-of-the-box.

Two Factor Authentication via TOTP for all your Users out-of-the-box. This packages adds a Contract to detect in a per-user basis if it should use Two Factor Authentication. It includes a custom view and a listener to handle the Two Factor authentication itself during login attempts. It is not invasive, but you can go full …

How to refactor complex if-statements

In this video, which is a part of the Mailcoach video course, Freek shows us how he refactors a complex if-statement. A technique which I nowadays also like using myself – especially in a React Component’s render method – is to use early returns: instead of nesting if-statements and using else-statements, the function body uses …

Symfony 5: The Fast Track

Symfony 5 recently got released. Fabien Potencier – Symfony’s creator – has also published a book along with its release. This book – written by Symfony’s creator – lays out a pragmatic approach to developing web applications with Symfony 5: from scratch to production. Whether you are discovering Symfony for the first time or refreshing …

Roadrunner – High-performance PHP application server, load-balancer, and process manager written in Golang

RoadRunner is an open-source (MIT licensed), high-performance PHP application server, load balancer, and process manager. It supports running as a service with the ability to extend its functionality on a per-project basis. RoadRunner includes PSR-7 compatible HTTP server. RoadRunner runs your application in the form of workers. The workers are kept alive in between requests. …