Replies

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

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

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

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

jclermont,
@jclermont@phpc.social avatar

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

sarah, to random
@sarah@phpc.social avatar

How do people locate and remove dead code from their projects in PHP these days?

jclermont,
@jclermont@phpc.social avatar

@sarah Rector with the dead code set is a great first pass.

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

jclermont,
@jclermont@phpc.social avatar

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

grmpyprogrammer, to Laravel
@grmpyprogrammer@phpc.social avatar

For folks who are using Pest for tests — what is the equivalent of using the RefreshDatabase and TestDatabase traits?

jclermont,
@jclermont@phpc.social avatar

@grmpyprogrammer I still use PHPUnit, but in Pest there's a uses global function for configuring the base test class and traits

Something like: uses(TestCase::class, RefreshDatabase::class)->in('Feature');

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.

jclermont, to php
@jclermont@phpc.social avatar

Here's a fun gotcha I discovered the hard way: Routes can resolve differently depending on whether you've cached them or not. #php #laravel https://masteringlaravel.io/daily/2023-12-28-routes-resolve-differently-when-cached

jclermont,
@jclermont@phpc.social avatar

@sarah Every programming decision has trade-offs. I find Laravel to be overwhelmingly positive, despite not being perfect. And in this case, I was doing something dumb, so I'll cut the framework some slack.

jclermont, to php
@jclermont@phpc.social avatar

Here's why we like to cache routes and views in CI, just like we do in production. It brings benefits other than performance. #php #laravel https://masteringlaravel.io/daily/2023-12-27-the-benefits-of-caching-in-ci

jclermont,
@jclermont@phpc.social avatar

@tvbeek do you run your tests in CI after caching config? I’m still digging into the particulars, but our tests fail with a cached config.

jclermont,
@jclermont@phpc.social avatar

@tvbeek got it, that makes sense. So it’s a smoke test that the command runs, you’re not trying to run your tests with the cached environment (though I do recommend running tests with routes cached, I’ll share a bug story tomorrow as to why)

jclermont,
@jclermont@phpc.social avatar
ian, to random
@ian@phpc.social avatar

Conference ticket and hotel for @phptek 2024 have been booked. Just attending this time rather than speaking like I did in 2023...and 2016, my first time speaking at a PHP conference.

Thinking back, this will be the first PHP conf for which I have nothing special on my badge (speaker or organizer) since SunshinePHP 2020 (and before that php[world] and JestPHP in 2019). I've attended other confs recently (five this year, in fact), just not PHP ones.

Nature is healing???

jclermont,
@jclermont@phpc.social avatar

@ian @phptek See you there!

jclermont, to php
@jclermont@phpc.social avatar

Why we don't use return types on controller actions, but we do like return types in general! #php #laravel https://masteringlaravel.io/daily/2023-12-13-why-we-dont-use-return-types-on-controller-actions

jclermont,
@jclermont@phpc.social avatar

@mwop Ah, that does sound nice 😀

jclermont, to Laravel
@jclermont@phpc.social avatar

Traditional caching comes with its own set of complexities. Here's a simple way to eliminate multiple queries in a request with a basic PHP language feature instead. #laravel #php
https://masteringlaravel.io/daily/2023-10-18-a-simple-way-to-avoid-multiple-lookups-within-a-request

jclermont,
@jclermont@phpc.social avatar

@shawnhooper I think jobs would be okay. The framework should boot fresh on each job execution. I haven’t tested it, but that’s my understanding of how Laravel runs jobs.

jclermont, to Laravel
@jclermont@phpc.social avatar

Today's tip is more of a thought experiment: What if every Composer package had a fee? Would it change how many packages you pull into your projects? #laravel #php https://masteringlaravel.io/daily/2023-09-08-what-if-every-composer-package-had-a-fee

jclermont,
@jclermont@phpc.social avatar

@kboyd Oh I'm definitely not advocating for that. I hope I didn't give that impression in the article.

jclermont,
@jclermont@phpc.social avatar

@kboyd I'm happy to hear that 😀

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