PHP Performance Trivia
β Edit
Nikita Popov discusses some low level performance optimizations in PHP.
β Edit
Nikita Popov discusses some low level performance optimizations in PHP.
David Khourshid explains how you can use state machines to make your logic more resilient.
Disabling a button is not logic. Rather, it is a sign that logic is fragile and bug-prone. In my opinion, disabling a button should only be a visual cue to the user that clicking the button will have no effect.
Read more [dev.to]
Join 9,500+ smart developers
Get my monthly newsletter with what I learn from running Spatie, building Oh Dear, and maintaining 300+ open source packages. Practical takes on Laravel, PHP, and AI that you can actually use.
No spam. Unsubscribe anytime. You can also follow me on X.
"Freekβs newsletter is one of the best ways to stay updated with the Laravel and PHP ecosystem. It consistently highlights useful packages, tools, and ideas from the community, especially the amazing work coming from Spatie. As a Laravel developer building SaaS and web platforms, I find it extremely helpful to discover practical tools and insights that improve my development workflow."
by Freek Van der Herten β 1 minute read β Edit
β rubenvanassche.com β Edit
My colleague Ruben explores the wonderful world of GitHub actions.
You can write workflows in YAML, which makes them easy to write and read. In the beta version of GitHub Actions you had to use Ocaml, which was quite hard to comprehend, and there was almost no documentation. If you were a bit frightened by the beta version, like me, then rest assured: the YAML version is easier to use, and the documentation is well written.
Read more [rubenvanassche.com]
β jasonmccreary.me β Edit
JMac, the creator of Laravel Shift, has a few interesting ideas on how to make the framework better.
Every so often a revolutionary change is required. This provides a chance to revisit goals. One of the primary goals of Laravel is developer experience. And maintainability, freshness, and approachability all improve developer experience. So, with all this in mind here are the top five things I would change in Laravel.
Read more [jasonmccreary.me]
by Freek Van der Herten β 2 minute read β Edit
My team and I are currently building Mailcoach, a self-hosted solution to easily send out newsletters and email campaigns. In this video, I live code a new small feature.
This video was created unrehearsed and I didn't make any edits. So you can see every mistake that I made along the way.
by Freek Van der Herten β 17 minute read β Edit
A year ago, I wrote a recap of 2018. Now that 2019 is coming to a close, I thought it might be fun to write a similar post on what I did this year.
β twitter.com β Edit
Not sure if your dependencies are up-to-date? Run `composer outdated` and find out. β‘οΈ pic.twitter.com/6ZShopPapn
— NUNO MADURO β (@enunomaduro) December 3, 2019
Read more [twitter.com]
β twitter.com β Edit
Thanks to the improved type variance in PHP 7.4, the `self` return type hint is now safe to use in a class that you expect to be overridden (happens a lot in the packages we create)
— Freek Van der Herten (@freekmurze) December 3, 2019
Demo: https://t.co/7vRTaOwRhD
RFC: https://t.co/1RpnFIjlKC#php pic.twitter.com/SfAaxRDt4m
Read more [twitter.com]
β stitcher.io β Edit
As usual, my colleague Brent wrote a post with clear instructions on how to upgrade. As a bonus he also provides some necessary steps to get PHP 7.4 to work in Valet.
Read more [stitcher.io]
by Freek Van der Herten β 3 minute read β Edit
In PHP 7.4, two new features were introduced that I'd like to use in my packages and projects: short closures and typed properties. Even though an IDE can help with converting to the new syntax, I'd don't want to manually hunt down all the places where the new syntax can be used. Lucky there's a tool that can do this work automatically.
β twitter.com β Edit
?You can mutate request data using @laravelphp 's form requests instead of doing it in the controller. By overwriting the validationData() method, you can mutate data BEFORE validation. Overwrite the validated() method to mutate AFTER validation. #Laravel #php pic.twitter.com/VAVXYAHCFC
— Neil Keena (@neilkeena) November 4, 2019
Read more [twitter.com]
by Freek Van der Herten β 3 minute read β Edit
A while ago, I created an easy to use framework agnostic PHP package to read and write CSV and Excel files called spatie/simple-excel. Behind the scenes, generators are used to ensure low memory usage, even when working with large files. Today I added a method that allows you to stream CSV files to the browser. In this small blog post, I'd like to demonstrate how you can use it.
by Freek Van der Herten β 3 minute read β Edit
β jolicode.com β Edit
FFI lets you include external libraries written in other programming languagues in your PHP code.
PHP Foreign Function Interface, or FFI for fans, is a PHP extension that allows you to include with ease some externals libraries into your PHP code. That means itβs possible to use C, Go, Rust, etc. shared library directly in PHP without writing a PHP Extension in C. This concept exists for years in other languages like Python or Go.
Read more [jolicode.com]
β medium.com β Edit
Kevlin Henney wrote a good post on the importance of naming things well.
Good naming is part of design. It sets expectations and communicates a model, showing how something should be understood and used. If you mean to tell the reader getMillisSince1970, donβt say getTime.
Read more [medium.com]
β pociot.dev β Edit
I'm a big fan of this approach and use Form Request like this quite often.
Let me show you what form requests can do for you - and how you can make use of them to write beautiful, expressive APIs.
Read more [pociot.dev]
by Freek Van der Herten β 6 minute read β Edit
β stitcher.io β Edit
PHP 7.4 will probably be released this week. My colleague Brent wrote a good post on all the shiney new things this release brings.
PHP 7.4, the latest version before PHP 8, brings lots of new features, syntax additions and fixes. We need to wait a little longer though: PHP 7.4 will be released on November 28, 2019. In this post you'll find a list with everything that's new and changed to help you prepare for the upgrade.
Read more [stitcher.io]
β Edit
A cool talk by John Cinnamond, on how you can create a pure OO language and why you shouldn't do that.