We Love PHP Attributes

Поділитися
Вставка
  • Опубліковано 29 січ 2025

КОМЕНТАРІ • 41

  • @Frank-ou2nr
    @Frank-ou2nr 3 місяці тому +19

    Whats up with the random music starting at 7:51 and making the explanation very hard to hear?

    • @kouceylahadji
      @kouceylahadji 3 місяці тому

      I agree

    • @isaachatilima
      @isaachatilima 3 місяці тому

      Right.. it served no purpose at all.

    • @sllkevin8885
      @sllkevin8885 3 місяці тому

      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 👍

    • @LaravelPHP
      @LaravelPHP  3 місяці тому

      That was a mistake, sorry for that. UA-cam does not let you change that after upload. (Christoph)

    • @ticorj
      @ticorj Місяць тому

      I thought I pressed something on my keyboard and spotify started lol

  • @AmenAmenzo
    @AmenAmenzo 3 місяці тому +2

    This started to look like Spring :D the lovely parts which is amazing! keep up the amazing work

    • @LaravelPHP
      @LaravelPHP  3 місяці тому +1

      Thank you so much! 🙏 (Christoph)

  • @einarjhansen
    @einarjhansen 3 місяці тому

    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.

    • @LaravelPHP
      @LaravelPHP  3 місяці тому

      thanks a lot, appreciate it 🙏 I hope so too =) (Christoph)

  • @incoming-th
    @incoming-th 3 місяці тому +22

    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.

    • @Silas_229
      @Silas_229 3 місяці тому +4

      They remind me of jakarta and this java enterprise stuff is just awful

    • @hydrokat143
      @hydrokat143 3 місяці тому

      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.

    • @CosmicNox-cn1
      @CosmicNox-cn1 3 місяці тому +1

      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.

  • @rogue.ganker
    @rogue.ganker 3 місяці тому +15

    Clean and nice until someone adds like 10 to it and abuses it

    • @ericadedayo1593
      @ericadedayo1593 3 місяці тому

      I thought it would be a great idea to use the Attribute and the booted() for more if it exist.

  • @Htbaa
    @Htbaa 3 місяці тому +5

    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.

  • @SebastianMares
    @SebastianMares 3 місяці тому +4

    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.

    • @LaravelPHP
      @LaravelPHP  3 місяці тому

      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)

  • @smokeyoak
    @smokeyoak 3 місяці тому

    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

    • @LaravelPHP
      @LaravelPHP  3 місяці тому

      Awesome, all the best! (Christoph)

  • @Voltra_
    @Voltra_ 3 місяці тому

    They're really handy! I also really like spatie's route attribute package that makes routing a breeze with controllers

    • @LaravelPHP
      @LaravelPHP  3 місяці тому

      thanks a lot. Yeah that is cool too, but web.php is 😍 (Christoph)

  • @Ali-hh9oi
    @Ali-hh9oi 3 місяці тому +1

    Try lift package for model attributes and also there is a spatie routing with attribute package.

  • @SXsoft99
    @SXsoft99 3 місяці тому +1

    I never liked comments as code in simfony and was the main reason i stuck with laravel, but I admit they have their moments.

    • @LaravelPHP
      @LaravelPHP  3 місяці тому

      Yeah a lot of different opinions about them, thats why we have multiple solutions. (Christoph)

  • @adrianspacely
    @adrianspacely 3 місяці тому

    Sounds like there should be a `#[ModelScopeBy(CustomUserEloquentBuilder::class)]`

  • @dominikbetlej7114
    @dominikbetlej7114 3 місяці тому

    Thx!

  • @daresamiuel
    @daresamiuel 3 місяці тому

    🎉🎉🎉

  • @favourdev
    @favourdev 3 місяці тому

    Its just easier to use the where method 2:30

  • @parijke
    @parijke 3 місяці тому +1

    I really could not listen to you anymore after 8 minutes when the music started.... Why?

    • @LaravelPHP
      @LaravelPHP  3 місяці тому +1

      That was a mistake. Sorry about that. UA-cam does not let you change such mistakes. (Christoph)

  • @gilney.mathias
    @gilney.mathias 3 місяці тому +9

    i for one really dont like those ¯\_(ツ)_/¯

    • @LaravelPHP
      @LaravelPHP  3 місяці тому

      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)

  • @pippop9583
    @pippop9583 2 місяці тому

    This is the dotnet feature every long time ago to make your code look ugly

  • @pippop9583
    @pippop9583 2 місяці тому

    I don't like it anyway

  • @irfanamir7778
    @irfanamir7778 2 дні тому

    I am reporting this because video doesn't match with title. Clickbait alert

    • @LaravelPHP
      @LaravelPHP  2 дні тому

      Why do think the title doesn't match the content? (Christoph)

  • @RexTangle4
    @RexTangle4 3 місяці тому

    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

    • @LaravelPHP
      @LaravelPHP  3 місяці тому

      Fair enough. That's why we provide multiple options 👍 (Christoph)