Great video Cristoph! Super useful for catching up and seeing what’s moving in the Laravel world. I got a feeling we will see a lot more attributes in the months to come.
I have mixed opinions with those attributes, because it can be useful and shorthand, I don't think they are clean because I have a lot of docblock and mixing with those attributes it's making the code like a mess to read. All those videos are presenting the attributes without a docblock.
I can see that the attributes work as "doc blocks" alr. Personally i would still prefer doc blocks for my old and current projects. Maybe ill try using these over doc blocks in the future.
I still don't know if it's a good or a bad idea either. In the first case presented, it's kinda cool because it doesn't shadow the logic. Nothing too magic. But it can be quite messy if there are too much attributes. I still prefer a config file with all observers/scope defined. It's more obvious and all at the same location. Less magic, less headaches when maintenance is needed.
I have mixed opinions. Adding alternative ways to do some things might seem nice and flexible, but imagine being a new developer in a large project that isn't well documented and you have to start to check for attributes, observables, magic functions, etc.
Thanks. I agree that can become difficult but this is always the case with big projects and when you provide different options and Laravel is in many ways quite flexible which is also what many like. Let's see what the future holds with Attributes. (Christoph)
There are a lot of ideas in here that are new to me, this was helpful. I'll definitely be using attributes in my requests now because I've made some messes in there in the past
So :: couldn’t be used for namespaces as it was already used for something else but a line starting with a hashtag, which is used for a comment, is perfectly fine? For me this is just one big unreadable mess.
Thats ok, thats why we have multiple options. To be honest, I didn't like them at all when they came out in PHP some time, but it changed for me :-) (Christoph)
honestly hate these (sorry). comment syntax should be reserved for comments. if we're going to invent a new way to inject logic it should be 100% clear that's what we're doing
Great video Cristoph! Super useful for catching up and seeing what’s moving in the Laravel world. I got a feeling we will see a lot more attributes in the months to come.
thanks a lot, appreciate it 🙏 I hope so too =) (Christoph)
I have mixed opinions with those attributes, because it can be useful and shorthand, I don't think they are clean because I have a lot of docblock and mixing with those attributes it's making the code like a mess to read. All those videos are presenting the attributes without a docblock.
They remind me of jakarta and this java enterprise stuff is just awful
I can see that the attributes work as "doc blocks" alr. Personally i would still prefer doc blocks for my old and current projects.
Maybe ill try using these over doc blocks in the future.
I still don't know if it's a good or a bad idea either.
In the first case presented, it's kinda cool because it doesn't shadow the logic. Nothing too magic.
But it can be quite messy if there are too much attributes.
I still prefer a config file with all observers/scope defined. It's more obvious and all at the same location.
Less magic, less headaches when maintenance is needed.
Whats up with the random music starting at 7:51 and making the explanation very hard to hear?
I agree
Right.. it served no purpose at all.
I didn’t notice, it wasn’t hard to hear for me listening on mobile but could see how it would be distracting or hard to hear on some devices 👍
That was a mistake, sorry for that. RUclips does not let you change that after upload. (Christoph)
This started to look like Spring :D the lovely parts which is amazing! keep up the amazing work
Thank you so much! 🙏 (Christoph)
Clean and nice until someone adds like 10 to it and abuses it
I thought it would be a great idea to use the Attribute and the booted() for more if it exist.
I have mixed opinions. Adding alternative ways to do some things might seem nice and flexible, but imagine being a new developer in a large project that isn't well documented and you have to start to check for attributes, observables, magic functions, etc.
Thanks.
I agree that can become difficult but this is always the case with big projects and when you provide different options and Laravel is in many ways quite flexible which is also what many like. Let's see what the future holds with Attributes. (Christoph)
They're really handy! I also really like spatie's route attribute package that makes routing a breeze with controllers
thanks a lot. Yeah that is cool too, but web.php is 😍 (Christoph)
There are a lot of ideas in here that are new to me, this was helpful. I'll definitely be using attributes in my requests now because I've made some messes in there in the past
Awesome, all the best! (Christoph)
So :: couldn’t be used for namespaces as it was already used for something else but a line starting with a hashtag, which is used for a comment, is perfectly fine? For me this is just one big unreadable mess.
I never liked comments as code in simfony and was the main reason i stuck with laravel, but I admit they have their moments.
Yeah a lot of different opinions about them, thats why we have multiple solutions. (Christoph)
Try lift package for model attributes and also there is a spatie routing with attribute package.
Sounds like there should be a `#[ModelScopeBy(CustomUserEloquentBuilder::class)]`
Thx!
Its just easier to use the where method 2:30
🎉🎉🎉
I really could not listen to you anymore after 8 minutes when the music started.... Why?
That was a mistake. Sorry about that. RUclips does not let you change such mistakes. (Christoph)
i for one really dont like those ¯\_(ツ)_/¯
Thats ok, thats why we have multiple options. To be honest, I didn't like them at all when they came out in PHP some time, but it changed for me :-) (Christoph)
This is the dotnet feature every long time ago to make your code look ugly
I don't like it anyway
honestly hate these (sorry). comment syntax should be reserved for comments. if we're going to invent a new way to inject logic it should be 100% clear that's what we're doing
Fair enough. That's why we provide multiple options 👍 (Christoph)