Posts

This profile is from a federated server and may be incomplete. Browse more on the original instance.

jclermont, to php
@jclermont@phpc.social avatar

How do you test code you don't understand? We deal with this when joining legacy projects, but I recently found a novel solution involving fuzz testing. Super useful! https://masteringlaravel.io/daily/2024-05-31-how-do-you-test-code-you-dont-understand

jclermont, to php
@jclermont@phpc.social avatar
jclermont, to php
@jclermont@phpc.social avatar

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. #php #laravel https://masteringlaravel.io/daily/2024-05-27-dont-use-the-config-helper-in-a-config-file

sarah,
@sarah@phpc.social avatar

@jclermont isn’t it better practice to inject the config you need into the places you need it, rather than globally calling a function?

jclermont,
@jclermont@phpc.social avatar

@sarah Perhaps, but in practice the global function calling the app container has never caused any problems for me. And you definitely could inject the config repository where needed, it's just not conventional Laravel. I prefer sticking with conventions.

jclermont, to php
@jclermont@phpc.social avatar

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. #php #laravel https://masteringlaravel.io/daily/2024-05-21-disabling-composer-timeout-with-nested-scripts

jclermont, to php
@jclermont@phpc.social avatar

How do you discover interesting new packages for your Laravel apps? #php #laravel https://masteringlaravel.io/daily/2024-05-20-how-do-you-discover-interesting-new-packages

grmpyprogrammer,
@grmpyprogrammer@phpc.social avatar

@jclermont Three step process:

  1. ask a question about how to do something
  2. from an alt account give a wrong answer
  3. watch angry techbros and replyguys give you the correct answer
jclermont,
@jclermont@phpc.social avatar

@grmpyprogrammer this is some 4-d chess right here 😂

jclermont, to php
@jclermont@phpc.social avatar

Here's a quick write-up of why I avoid logic inside my tests #php #laravel https://masteringlaravel.io/daily/2024-05-14-avoid-logic-inside-your-test

jclermont, to php
@jclermont@phpc.social avatar
jclermont, to php
@jclermont@phpc.social avatar

Yes, I'm a bit of a PHPStorm fan boy. Here's another handy use for the Local History feature. #php #laravel https://masteringlaravel.io/daily/2024-05-02-another-helpful-use-for-local-history

jclermont, to php
@jclermont@phpc.social avatar

Fresh off php tek last week, I'm reminded that conferences are so much more than just the talks. #php #laravel https://masteringlaravel.io/daily/2024-05-01-conferences-are-more-than-just-talks

jclermont, to php
@jclermont@phpc.social avatar

You might need to do this a lot, but here is an explanation how to step debug a queued job. #php #laravel https://masteringlaravel.io/daily/2024-03-20-how-to-step-debug-a-queued-job

jclermont, to php
@jclermont@phpc.social avatar

Ever import a big sql dump and feel impatient wondering how much time was left? Here's an easy way to monitor progress. #php #laravel https://masteringlaravel.io/daily/2024-03-18-monitoring-progress-of-a-big-database-import

ramsey,
@ramsey@phpc.social avatar

@jclermont It was hard to read this in a non-scatological way. 😅

jclermont,
@jclermont@phpc.social avatar

@ramsey Oh man, now I'm ruined too. Thanks!

jclermont, to php
@jclermont@phpc.social avatar

Why I always add a primary key to many-to-many tables, even when Laravel doesn't require it. #php #laravel https://masteringlaravel.io/daily/2024-03-12-why-i-always-add-a-primary-key-to-many-to-many-tables

jclermont, to php
@jclermont@phpc.social avatar

What is the point of design patterns? And can we discuss this without putting you to sleep? Check out the latest episode of the No Compromises podcast. https://masteringlaravel.io/daily/2024-02-29-laravel-podcast-what-is-the-point-of-design-patterns

jclermont, to php
@jclermont@phpc.social avatar

I really enjoy consistency and patterns in my code. Here is my approach to organizing test methods within a Laravel feature test. #php #laravel https://masteringlaravel.io/daily/2024-02-21-consistent-test-organization

shawnhooper,
@shawnhooper@fosstodon.org avatar

@jclermont I've started to structure my controllers using the invokable style, with a single file for each endpoint/verb combination.

This has had a side effect of cleaning up my tests as well. Each file tests the authorization, success/failure paths, etc., in a short(er) file that's easier to read through.

jclermont, to php
@jclermont@phpc.social avatar

Laravel recently added a password validation rule to more easily enforce a maximum length. Why would you ever want to limit the length of a password? Here's an explanation how it actually improves security. https://masteringlaravel.io/daily/2024-02-05-why-does-laravel-offer-a-max-password-length-validation-rule

jclermont,
@jclermont@phpc.social avatar

@heiglandreas That's a fair point, and the default max being discussed is 72 (due to bcrypt internals), so it would not violate the NIST recommendation.

heiglandreas,
@heiglandreas@phpc.social avatar

@jclermont That's absolutely right!

Sadly advertising a tool to set a max password length (to avoid the password being truncated at 72 chars) will cause people to abuse it to set the max length to whatever some projectmanager thinks is enough (12 chars).

BTW: Is that truncating at 72 chars or bytes... 🙈

  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • thenastyranch
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • ngwrru68w68
  • provamag3
  • magazineikmin
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • anitta
  • Leos
  • tester
  • JUstTest
  • All magazines