Joel Clermont
@jclermont@phpc.social
Organizer of Milwaukee PHP. Co-host of No Compromises #podcast. Helping #PHP and #Laravel developers level up their skills.
- Podcast
- https://show.nocompromises.io
- Blog
- https://joelclermont.com
- Training
- https://masteringlaravel.io
- Need Help?
- https://nocompromises.io
Recent public posts
- A simple code review question made me rethink converting a collection to an array. Do you have a reason for your choice? #php #laravel https://masteringlaravel....
- Your legacy data has a mix of upper and lowercase values, and you want to standardize with a new enum. You could update the whole table, but here's another appr...
- A user making 120 requests a minute seems fine. All 120 in a single second, not so much. Laravel can tell the difference. #php #laravel https://masteringlaravel...
- Your update form request matches the store request, except for one extra field. You don't need to duplicate anything to handle it. #php #laravel https://masteri...
- The Laravel docs set up mocks inside a closure, and most of us copied that pattern. There's a flatter way to write the same mock. #php #laravel https://masterin...
- Switching to the stricter assertSame broke a test that returns a collection. There's a simple fix that keeps the stricter check in place. #php #laravel https://...
- You don't need to prove Laravel returns a 429 after too many requests. But there are a couple of rate limiting decisions in your app that are worth a test. #php...
- Your permission test passes, but is it passing for the right reason? A small change in setup gives you real confidence. #php #laravel https://masteringlaravel.i...
- Your class uses a trait that calls an external service, and you want to mock it in a test. It's possible, but it may not solve the problem you actually have. #p...
- Adding a column in the middle of a big MySQL table used to be expensive. Is it still? The answer depends on more than you might think. #php #laravel https://mas...
- Date logic is easy to over-test and easy to under-test. Here's how I decide what deserves a test, plus a Carbon default that catches people off guard. #php #lar...
- Testing every variation of a complex API resource through full HTTP requests gets slow. There's a lighter way to cover them all. #php #laravel https://mastering...
- Checking whether a relationship has any records can quietly load every row. One small change makes the database do the work instead. #php #laravel https://maste...
- Testing a final class is no problem. Mocking one is where things get tricky, and the workaround Mockery suggests is not without issues. #php #laravel https://ma...
- Laravel's partialMock helper won't let you pass constructor arguments. Here's how to get around it without giving up the mock. #php #laravel https://masteringla...
- A student couldn't figure out how to force an exception for a test. So I asked a question about what they were trying to test in the first place. #php #laravel ...
- Your Blade component falls back to old form input. How do you test that without building a whole request and session? #php #laravel https://masteringlaravel.io/...
- Something happened almost two days ago, but Carbon swears it was just one. Here's why, and two ways to get a more honest answer. #php #laravel https://mastering...
- Your scheduled commands probably reference a string signature. There's a less brittle option that makes them easier to find and refactor. #php #laravel https://...
- Laravel can spot a lazy loaded relationship inside a loop and load it for the whole collection at once. But it doesn't do quite the same thing as chaperone. #ph...