@killianblais@piaille.fr avatar

killianblais

@killianblais@piaille.fr

Lead Developper @Ettic.org @TeamOfficine | #PHP #Laravel #Postgresql | #starwars metal | Papa 👧🏻 + 🧒🏻

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

shawnhooper, to php
@shawnhooper@fosstodon.org avatar

Do you use Carbon for your Date calculations? The diffIn* methods have changed in V3.

This is documented, but still caught me by surprise when testing updating to 11.

https://shawnhooper.ca/2024/04/11/breaking-change-diffin-carbon/

killianblais,
@killianblais@piaille.fr avatar

@shawnhooper yeah, we discovered that by chance when, without changing the tests, our test suite failed after upgrading... It seems to me that it should be covered by Laravel upgrade guide

mikestreety, to Laravel
@mikestreety@hachyderm.io avatar

I'm doing some development and have run into the same quandary I always do.

I have some code which connects to an API and gets some data to save to a model in the Database. Where do I put the code which does the fetching?

I want it as a command but also accessible via a controller. Is it a service? Or do I just make a new folder in app with my classes in there?

killianblais,
@killianblais@piaille.fr avatar

@mikestreety I usually create a Services namespace, and put my XService there.
I can call it from anywhere I want using dependency injection, and I try to decouple it from my app as much as I can, using transformer classes (placed in the Services\X namespace) to translate from the API to my models (or the other way).

  • 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