Earlier quoted context omitted.
Have you looked at any Laravel code? As someone who has worked from small startups to FAANG and inbetween, Javascript to PHP to Python to Go, I haven't found anything more elegant.
I have. Elegant it is not. Actually, it smells like Enterprise Java code, which made me flee from the Java ecosystem. To each his own, but this is not an elegant event listener (copied from the examples page): use App\Events\ArtistInformationFetched; use App\Services\MediaMetadataService; use Throwable; class DownloadArtistImage { private MediaMetadataService $mediaMetadataService; public function __construct(MediaMe…
https://laravel.com/docs/8.x/container#introduction
Or, if you wanted something perhaps at least use one of their featured partners for real code? https://github.com/tighten/jigsaw/blob/main/src/Jigsaw.php
I also would argue that the majority of code I see in other languages is equally or worse than the example you gave.
You can write terribly in any language, Laravel included.