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

Oh. My. Fucking. God.

I have just learned that "#Java Bean" has two completely different and incompatible definitions.

One is a dumb, badly designed data object with getters and setters.

The other is... a service object managed by the Spring framework IoC container.

Holy hell. This is 10x worse than #Laravel "facades."

Am I wrong here? This is what I'm finding from online tutorials. Is there more nuance that is not coming through, because for now I just hate #Spring even more.

#Kotlin

shadowhand,
@shadowhand@phpc.social avatar

@Crell I have always been confused by this as well... 😳

heiglandreas,
@heiglandreas@phpc.social avatar

@Crell That is about the only Java Bean that I will ever consider seriously.

tjventurini, to Laravel
@tjventurini@mastodon.social avatar

Hi 👋 I'm looking to #connect with people who are interest in

🌐 Web Development
🎨 Web Design
🧑‍💻 #Coding
🧰 #Laravel
👀 #Vue
💼 #Freelancing

#letsconnect

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.

doefom, to Laravel
@doefom@mastodon.social avatar

Macros are one thing I enjoy using the most in . It's a way to extend the functionality of many built-in by providing custom callbacks for a specific key.

One production example I use macros for fairly often is what I call the "admin alert". Especially in smaller applications I want to get notified whenever an error or an event occurs the admin (mostly that's me) should know about.

Here's what this might look like.

emd,
@emd@cosocial.ca avatar

@doefom welcome, let me know if I can help you get going with them

doefom,
@doefom@mastodon.social avatar

@emd thanks for the offer! Do you know a GitHub repo where this is used and I can take a look at?

doefom, to Software German
@doefom@mastodon.social avatar

What’s the best piece of #software you use in your daily work as a #laravel developer?

emd,
@emd@cosocial.ca avatar

@doefom Ray

doefom,
@doefom@mastodon.social avatar

@emd how could I not know this exists. Thanks for the hint! Will try this

michael, to Laravel
@michael@thms.uk avatar

So, it really annoyed me that in Laravel 11 you cannot have multiple listeners for the same event in an array like you could in Laravel 10.

It's not like it's a big deal, as it's simple enough to implement, but just seems like a step backwards.

What do you think?

https://blog.thms.uk/2024/05/event-listeners-laravel-11?utm_source=mastodon

#Laravel #PHP

stefanzweifel,
@stefanzweifel@phpc.social avatar

@michael Will replicate this EventServiceProvider in one of our apps, once we start migrating it to Laravel 11.

Not a big fan of the auto-discovery or the new way of registering events.

michael,
@michael@thms.uk avatar

@stefanzweifel yeah, not a big fan of auto discovery either.

It just makes events way too opaque, in my opinion.

emd, to Laravel
@emd@cosocial.ca avatar

What am I missing folks, you can't have multiple listeners (in an array) in v11?

https://laracasts.com/discuss/channels/laravel/laravel-11-register-event-with-multiple-listeners

michael,
@michael@thms.uk avatar

@emd quite. I think autodiscovery for events isn’t great either to be honest.

Events already run the risk of stuff happening in opaque ways. This is gonna be even worse now.

michael,
@michael@thms.uk avatar

@emd I've just created this function in my AppServiceProvider. A bit silly that I now need to do this manually, imo, but not a big deal I suppose 🤷‍♂️

doefom, to Laravel
@doefom@mastodon.social avatar

Using global query scopes for simple one-to-many tenancy.

Code example of a cat pension app I've started and never finished. It's structured like this:

  • A user belongs to a pension
  • A pension has many clients
  • A client has many animals

Users (cat pension owners and their employees) can only view clients and animals from the same pension. Global query scopes ensure this rule is consistently applied throughout the app without accidentally forgetting it somewhere in your code.

doefom, to Laravel
@doefom@mastodon.social avatar

When developing applications I'm always a little afraid of sending emails to actual customers or placing real orders by accident. So I came up with a habit that works super well for me and maybe this will suit you as well.

In my /config/mail.php I add a 'developer' email address and ensure in my AppServiceProvider all emails are sent to this address when in non-production environments no matter what. Makes me build and test stuff way more confidently 😁

Is there a better approach?

doefom, (edited )
@doefom@mastodon.social avatar

@rolfdenhartog That's a great solution, thanks! For such cases I usually work with Laravel Herd. However, many times I know my clients work with outlook for example and then I ensure everything looks fine in outlook. But still, your approach in general feels cleaner than adding my code snippet to the service provider.

doefom,
@doefom@mastodon.social avatar

@mmk2410 that's great, thanks! :)

marmelab, to php
@marmelab@mastodon.social avatar

🎉 Exciting news! Marmelab is sponsoring the API Platform Conference 2024, the flagship event dedicated to the API Platform framework!

Join us for 2 days of talks by leading experts in , & .

📅 19 & 20 September
📍 Lille, France

Learn more: https://api-platform.com/fr/con/2024/

@cooptilleuls

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 😂

doefom, to php
@doefom@mastodon.social avatar

#PHP 8.4 is introducing newing up a class and accessing methods, properties, etc. on it without wrapping it in parentheses first. Another useful feature I will probably use on a daily basis. In my daily work with #Laravel I often need to crawl some content from a website or an API. This feature will make my code a little less cluttered.

Here is the RFC if you want to learn more about it: https://wiki.php.net/rfc/new_without_parentheses

Crell, to php
@Crell@phpc.social avatar

Please, web app developers, consider how your users will upgrade. If your upgrade process is "remove the old one, unzip the new one", then it's not an upgrade process. It's an encouragement to never upgrade.

#PHP #Laravel #Programming

bobmagicii,
@bobmagicii@phpc.social avatar

@Crell remove the old one?!?!?!? i shout yolo unzip that shi on top boiiiiiiiiiiiiii 🤣 🤣 🤣 🤣

velkuns,
@velkuns@phpc.social avatar

@Crell @acelaya I created a deployer component.

I can integrate it in my app to deploy it in production.
I need to have a git repo on the server (mainly for private repo). And it configurable with y'all config.

But with a cli command, the component will:

  • creates an export of given tag
  • extracts it in some place
  • runs composer install
  • can run some other commands
  • copies secret files into app dir
  • create a symlink (for apache)

In case of problem, I redo a symlink on previous version

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