๐ Author of Mastering Laravel Validation Rules
โ๏ธ I post useful Laravel tips
๐๏ธ Co-host of http://show.nocompromises.io podcast
๐ Organizer of Milwaukee PHP
Why we don't queue password reset emails masteringlaravel.io/daily/2024-0...
Faster responses aren't always better
masteringlaravel.ioA nuanced opinion on validating URL request parameters masteringlaravel.io/daily/2024-0...
What error code should you use?
masteringlaravel.ioHave you ever wanted to add functionality to a third-party package quickly? Here's a way you could do it without forking the package or hacking your vendor folder masteringlaravel.io/daily/2024-0...
Laravel is so flexible
masteringlaravel.io
It's best practice to always use the config helper in our application code, except for one place: Don't use the config helper in config files.
Here's an explanation as to why. masteringlaravel.io/daily/2024-0...
Unless you like empty config values
masteringlaravel.ioThere was a change in PHP 8 that affects Laravel tests with database transactions. I wrote up the details in case you bump into the "There is no active transaction" error. masteringlaravel.io/daily/2024-0...
The error was there all along...
masteringlaravel.io
Admins can do everything in the app, right? Well, maybe not.
In the latest episode of the No Compromises podcast, Aaron and I discuss a couple of reasons why you may want to consider not letting an admin have access to every single feature in your app. masteringlaravel.io/daily/2024-0...
Maybe admins shouldn't have access to everything
masteringlaravel.ioWhat do you need to clean up after your tests? And how much of it does Laravel handle for you automatically? masteringlaravel.io/daily/2024-0...
Maybe less than you think
masteringlaravel.io
Ever run into a timeout from a Composer script in CI? Test coverage reports are a super common example for me.
Here's how to prevent that, along with a gotcha if you're calling scripts within scripts. masteringlaravel.io/daily/2024-0...
Useful for long-running CI pipelines
masteringlaravel.ioHow do you discover interesting new packages for your Laravel apps? masteringlaravel.io/daily/2024-0...
Here's a great resource
masteringlaravel.ioRead the docs for that package. It honestly doesn't even take that long. masteringlaravel.io/daily/2024-0...
It doesn't even take that long
masteringlaravel.ioHere's a sneaky bug that can bite you in regard to order of operations with the null coalesce operator masteringlaravel.io/daily/2024-0...
Have you ever tried to detach a fork from your GitHub repo? There's no super obvious way to do it, but it can be done! masteringlaravel.io/daily/2024-0...
This should be more obvious
masteringlaravel.ioHere's a quick write-up of why I avoid logic inside my tests masteringlaravel.io/daily/2024-0...
Here's how to set an env variable within a Composer script
(and why you might want to do it) masteringlaravel.io/daily/2024-0...
And why you might want to do it
masteringlaravel.ioHere's an easy way to merge long-running branches within the GitHub interface. masteringlaravel.io/daily/2024-0...
One button click away
masteringlaravel.ioHave you ever turned on error tracking in a long-lived app and then got overwhelmed by all the errors happening? In this recent podcast episode, we talk about strategies for managing it (and not putting your head in the sand either) masteringlaravel.io/daily/2024-0...
Or put your head in the sand
masteringlaravel.ioShould a factory always define a required field? Normally I'd say yes, but in a recent project I deviated from that for good reason. masteringlaravel.io/daily/2024-0...
Sometimes a little extra manual work makes for a better test
masteringlaravel.ioHere's how I deal with naming collisions in different namespaces masteringlaravel.io/daily/2024-0...
Optimize for simplicity
masteringlaravel.ioUsing Cloudflare to set up simple email forwarding. Even better, it's free. masteringlaravel.io/daily/2024-0...
And it doesn't cost anything
masteringlaravel.ioHere's why I always type-hint route parameters, even when I'm not using the parameter in my controller action. masteringlaravel.io/daily/2024-0...
Yes, I'm a bit of a PHPStorm fan boy. Here's another handy use for the Local History feature. masteringlaravel.io/daily/2024-0...
Fresh off of php tek last week, I'm reminded that conferences are so much more than just the talks. masteringlaravel.io/daily/2024-0...
They've had a huge impact on my career
masteringlaravel.ioAvoid some common Composer dependency issues and save yourself from a future surprise masteringlaravel.io/daily/2024-0...
Save yourself from a future surprise
masteringlaravel.ioHow to detect and safely remove dead code (even when static analysis can't find it) masteringlaravel.io/daily/2024-0...
Don't just ignore it
masteringlaravel.ioI'm always playing around with new ways of increasing my productivity, but the reality is I will never get everything done, and here's why that's okay. masteringlaravel.io/daily/2024-0...
Does it really matter how your code looks? We discuss on the latest episode of the No Compromises podcast. masteringlaravel.io/daily/2024-0...
It's not just about aesthetics
masteringlaravel.ioIs now the right time to clean up this data? The desire to make things better is good, but I have this internal debate all the time. masteringlaravel.io/daily/2024-0...
Keep a realistic outlook
masteringlaravel.ioA continuation of yesterday's PR story about collections vs arrays, this one deals with the testing side, and using assertSame instead of assertEquals. masteringlaravel.io/daily/2024-0...
Without making the test more complex
masteringlaravel.ioEver have trouble deciding if a data structure should be a collection or an array? Here's a story of a recent PR discussion. masteringlaravel.io/daily/2024-0...
Use the right tool for the job
masteringlaravel.ioHere's a strategy I use for testing permissions logic without false positives. masteringlaravel.io/daily/2024-0...
And avoiding false positives
masteringlaravel.ioHere is an easier (and faster!) way to get good test coverage for complex API resources masteringlaravel.io/daily/2024-0...
And the tests are fast too
masteringlaravel.ioI don't use this a lot, but I'm super glad the ability to rate-limit per second was added to Laravel. It used to be really hacky to implement, but so easy now. masteringlaravel.io/daily/2024-0...
Important for high-traffic applications
masteringlaravel.ioDevelopers love reusing code. For example, creating and updating a resource might have the exact same validation rules. But what if they're just ever-so-slightly different? It's all just arrays! masteringlaravel.io/daily/2024-0...
It's all just arrays
masteringlaravel.ioWhat is the difference between the different asset helpers in Laravel? masteringlaravel.io/daily/2024-0...
And which one should you use?
masteringlaravel.ioWhat is the longest valid email address? And how might it affect your validation rules? masteringlaravel.io/daily/2024-0...
And how does this impact validation rules?
masteringlaravel.ioYou launched a hobby project and then it starts to get some traction. What next? How do you get a more solid foundation under your app when it comes to database hosting? We discuss on the latest episode of the No Compromises podcast. masteringlaravel.io/daily/2024-0...
Start simple and grow as needed
masteringlaravel.ioPreventing performance surprises in production with Laravel migrations masteringlaravel.io/daily/2024-0...
Keep your system healthy
masteringlaravel.ioIs there a performance penalty in MySQL for inserting a column? It depends to a large degree on what version you're using. masteringlaravel.io/daily/2024-0...
Have you ever needed to pass constructor arguments to a mock in your Laravel tests? masteringlaravel.io/daily/2024-0...
You can't use Laravel's mock helper
masteringlaravel.ioHere's a story about a mistake I almost made when trying to optimize an Eloquent query masteringlaravel.io/daily/2024-0...
Keep your database happy
masteringlaravel.ioHow would you test code that uses the `old()` helper? masteringlaravel.io/daily/2024-0...
And why you might want to
masteringlaravel.ioHere's a better way to schedule commands (no magic strings needed) masteringlaravel.io/daily/2024-0...
Partial mocks don't run constructors by default. Here's an explanation why, along with a way to make them run if you really need it. masteringlaravel.io/daily/2024-0...
How to troubleshoot S3 filesystem issues masteringlaravel.io/daily/2024-0...
Silent failures are the worst
masteringlaravel.ioEveryone likes fast CI and a big way to get there is with caching. Here's an explanation of how the cache action works. masteringlaravel.io/daily/2024-0...
Keep CI running fast
masteringlaravel.ioInterfaces are a great tool for writing maintainable applications, but it is possible to go "too far" with abstraction. We discuss some trade-offs to consider in the latest No Compromises episode. masteringlaravel.io/daily/2024-0...
No really, are you sure?
masteringlaravel.ioHere's a basic middleware I use in my API projects to force all requests to accept JSON (and return the right HTTP status code if they don't) masteringlaravel.io/daily/2024-0...
Avoid annoying errors
masteringlaravel.io