This is the community on programming.dev dedicated to Laravel, a PHP web application framework with expressive, elegant syntax.

Whether you are new to Laravel or have years of experience, you’re more than welcome here. Rules and content guidelines may come later but any questions, suggestions, ideas about what this community may become or strive to, or any other comments are not only appreciated but encouraged.

You can use this thread to leave your comments or just introduce yourself to the community.

  • msage
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 year ago

    So one dev in my team decided to use Laravel for a project, which no one else has experience with. I’m not sure if it’s standard or not, but there seem to be a lot of static stuff being used. Is that the preferred way, or just something new people can do who don’t know any better?

    • bumcheekcity
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 year ago

      Laravel definitely uses a lot of static method calls. We use User::find($userID) to pick out a user and the Eloquent ORM uses static calls in the form User::where(‘name’, ‘Jim’)->where(‘age’, ‘>’, 20)->get() etc.

      • msage
        link
        fedilink
        English
        arrow-up
        2
        ·
        1 year ago

        Stuff like Facades really spook me since there’s got to be a better way.

        • bumcheekcity
          link
          fedilink
          English
          arrow-up
          1
          ·
          1 year ago

          What is it about them that’s a concern? Some specific use my your coworker that seems nonstandard?

          • msage
            link
            fedilink
            arrow-up
            1
            ·
            1 year ago

            I just don’t like using static classes, that’s all.