The amount of discussions I have to hold because #Laravel devs don't want to write a read-only DTO somewhere, but instead add a dynamic property on some ActiveRecord contraption.

It's so exhausting, and it could be so simple, if it wasn't that the framework promotes terrifyingly bad software practices everywhere. #php

@ocramius I took my final decision not to use Laravel unless absolutely needed (like paid for this) when I added lots of typehints, sent quite a large PR, and it was declined because "it's not needed at the moment". Then I said no, sorry not sorry. I like PHP's evolution, and writing in #PHP 5 style is something that doesn't inspire me.
@ocramius I wish there were more Symfony jobs around - I like doing things well. As it is, I may have to spend more time in the new year learning to use Laravel.  

@ocramius One of the first things we teach new team members is that the framework is a tool and not the way it should be.
(And a lot of packages are a lot worse than the framework 😒)

We push the framework to the infrastructure layer and have more rules to prevent some bad behaviour and lower the maintenance cost.

@ocramius I am literally right now introduce DTOs into an Laravel app to get rid of dynamic properties. So I don’t think it’s only the framework responsible, but also missing knowledge and not using PHPStan and alike.
@Konafets @ocramius out of curiosity: does the framework enforce any of those anti patterns or is it just bad documentation and tutorials?

@alexanderschnitzler PHP gave you the possibility to add properties to an object w/o declaring them. This is deprecated since 8.2 but can be overwritten by `#[AllowDynamicProperties]` or used by implementing `__set ` and `__get`.

Laravel does the latter to provide syntax sugar but does not encourage in the docs to add a property after retrieval nor blocks you from creating and using DTOs.

https://php.watch/versions/8.2/dynamic-properties-deprecated

@ocramius

PHP 8.2: Dynamic Properties are deprecated

PHP 8.2: Dynamic Properties are deprecated

PHP.Watch
@ocramius There seems to be an immutable law of software: Only shitty things get popular.

@Crell @ocramius oh yeah? then explain winamp? 😁

I think laravel's popularity has more to do with superior communication and onboarding, and some of the perceived engineering shittiness comes from architectural concessions made in service of that onboarding experience.

(Disclaimer: I don't like laravel & haven't worked with it. But I can't deny that it resonates with people.)

@kboyd Also: Only one defined way to do it. There is no "decide yourself". It is all decided for you.

The moment you want to do it differently you are on your own (best case) or working *against* the framework (usually). Which is a PITA

/cc @Crell @ocramius

@heiglandreas @kboyd @Crell not to mention that you get a horde of people saying "why are you going against the way of the framework?" every time you apply any sensible pattern taught since 1940 (Church) onwards

@ocramius @heiglandreas @kboyd @Crell Yes, like the crazed Taylor Swift fans (Swifties), only here it's Taylor Otwell. 🤪

Edit: just to be clear, this is joke

@heiglandreas Honestly, I’d love if there was only one way to do stuff. Less conventions needed. Haven’t had that experience with Laravel, though.
@ocramius ya I use DTOs as soon as the data is pulled from the DB to avoid that exact thing. This is with Laravel. Thankfully there’s often several ways to do something.