Great tip by Mattias: TIL: you can fake package versions in composer using the "as" alias. Useful to force install certain versions while keeping other dependencies in check! 👍https://t.co/VzmMRCCoR5 — Mattias Geniar (@mattiasgeniar) April 16, 2020 You can alias directly when requiring a package: composer require monolog/monolog:”dev-bugfix as 1.0.x-dev” Surely comes in handy when locally …
Tag Archives: php
Laravel Valet not picking up php.ini
changes, a fix
If you have Laravel Valet not picking up php.ini changes, try this: .@laravelphp Valet wasn't detecting any of the changes I made to php.ini. Restarting brew services and restarting Valet had no effect. Turns out the valet.sock file was being persisted and somehow caching settings. `rm ~/.config/valet/valet.sock` solved my problem! 🙌🏽 — Jose Soto (@JoseCanHelp) …
Continue reading “Laravel Valet not picking up php.ini
changes, a fix”
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 …
Continue reading “Demystifying Dependency Injection Containers”
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 …
Continue reading “Laraguard – Two Factor Authentication via TOTP for all your Users out-of-the-box.”
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 …