Laravel app can't possibly be THIS good... [Free course: Great Laravel Apps #2]

Поделиться
HTML-код
  • Опубликовано: 19 июн 2023
  • Hi there!
    In this series video I'll be showing you my preferred version of creating Laravel applications.
    I'll walk over the project structure that I absolutely love and cover:
    - Creating custom src/Modules/ directory
    - Custom Exceptions
    - Custom Resources
    - Services
    - Laravel's Container resolving interfaces
    - DTOs
    - Custom Query Buiders
    - Enums
    Resources:
    - Laravel's website: laravel.com
    - Custom Exceptions Video: • Laravel: The BEST way ...
    - Custom Resources Video: • Fixing Laravel's BIGGE...
    - Code repo: github.com/saas-laravel/larav...
    Course website:
    saaslaravel.com/
    More about me:
    przemyslawprzylucki.com
  • НаукаНаука

Комментарии • 26

  • @_timestamp
    @_timestamp Год назад +2

    I recognize a high quality youtube channel when i see one. This is one of them.

  • @nicolascanala9940
    @nicolascanala9940 Месяц назад

    Man you would love C# haha. Thanks for the video!

  • @navod_rashmika
    @navod_rashmika Год назад

    It's awesome. do more of these types of videos. all the best.🖤

  • @thirdvect0r
    @thirdvect0r Год назад +4

    Great vid as always! I definitely need to think more about my error handling, because I often rely on the built in exception types which never gives me the granularity I like without delving into stack traces on sentry :D
    Couple of personal preferences, absolutely just trying to contribute my ideas here
    12:15 - SettingType::from($request->validated('type')) can become $request->enum('type', SettingType::class) which I think has the advantage of being a bit more readable, and lets the caller know than we (probably) already validated for enum safety
    25:15 - Instead of passing an anonymous array of SettingDtos, I would like to have my storeMany method have the signature storeMany(User $user, ...Dto $dto). I prefer this because by splatting in the params you can get language level type safety on the arguments instead of relying on the doc block to help -- just call with $service->storeMany($request->user, ...$dtos) and you've got type safety on both sides :)

    • @saaslaravel
      @saaslaravel  Год назад +1

      These are great suggestions! Thank you!

  • @C0DE8
    @C0DE8 3 месяца назад

    Great Tutorial! THX. 👍
    One question, what us your PHPStorm Theme? Thanks in advance.🙏

  • @laksamanasulthanalam.s73
    @laksamanasulthanalam.s73 Год назад

    Really Great Content. Do you have any platform other than youtube, for example medium/github, i'd like to see your published project!

    • @saaslaravel
      @saaslaravel  Год назад

      Thanks so much! The source code of this project can be found in the description

  • @mpowerek77
    @mpowerek77 Год назад

    Hej, czy mógłbyś zrobić kontynuację kursu CI/CD? Mam z tym aktualnie spory problem. Czy CD jest w ogóle jakkolwiek możliwe w oparciu o github i dockerhub w aplikacji laravel?

    • @saaslaravel
      @saaslaravel  Год назад

      Hej, kontynuacja jest w planach :) CD jest możliwe z poziomu GitHub actions

  • @kenamreemas3295
    @kenamreemas3295 Год назад

    hello, can you please make a tutorial on how to integrate laravel cashier please?

  • @gazorbpazorbian
    @gazorbpazorbian Год назад

    I love your content! I have doubt, why do you like to split your project like that? could you be more specific and maybe get into the details of how companies handle the structure of a project?
    does the way you structure your project has a name? like a design pattern name?

    • @saaslaravel
      @saaslaravel  Год назад +1

      Thank you! The structure itself is not necessarily a design pattern but the entire approach presented allows you to create a better separation between business language and the application layer. It's def not DDD but it has some benefits of it. It's just a simple service + DTO pattern with things Laravel gives you for separation of concerns i.e resources and query builder classes

  • @limitlesskode
    @limitlesskode Год назад

    This is a really informing video I appreciate your efforts. However do you need DTOs when you can just use laravel models?

    • @saaslaravel
      @saaslaravel  Год назад +1

      Thank you! The purpose of DTOs is to move data from controller/command/job/external api to the service in unified way. Model doesn't exist at that point yet

    • @rGxDale
      @rGxDale Год назад

      Passing a user model into a module?

    • @saaslaravel
      @saaslaravel  Год назад +1

      User is usually an actor in that arrangement b/c they perform an action. But when you have like a PostService, you'd need two methods.
      public function store(User $actor, PostDto $dto): Post;
      public function update(User $actor, Post $post, PostDto $dto): Post;
      There is nothing wrong with passing models there. It's just the purpose of DTO is to move data and the persistence of that data would happen in the service or repository based on your liking

    • @rGxDale
      @rGxDale Год назад +1

      @@saaslaravel why pass the model in at all? Surly the setting table only needs a user_id for the scope to apply correctly. And now, without a model, it has no knowledge of the entirety of the user model. And the setting module doesn’t depend on the User /auth module. Ie the setting module should not be calling any methods on $user. Ie $user->changeName(‘hdhdh. Yes this causes you to have to use events to propagate other scope to settings and is a hole other subject but. But what could you need from $user? If you cant be bothered to take a user id from the user variable, would ot not be better for the module to take a Authentication Contact that user implements?

    • @rGxDale
      @rGxDale Год назад

      Yes you should pass a dto, or at least an interface. Only when the model is of another bounded context. There are two distinct types of service, domain and application. An application service uses the domain. Application services are mostly used when handling application level things. Integration events between bounded contexts. Domain services do things that don’t fit into a model. Things in the domain, but not exclusive to an individual entity of that domain. I can provide blog post? For code review if wish

  • @Novia5555
    @Novia5555 8 месяцев назад

    What code editor is that?

    • @saaslaravel
      @saaslaravel  8 месяцев назад

      It's PHP storm with Catpuccin theme

  • @mori181186
    @mori181186 10 месяцев назад

    "Great Laravel Apps" is not your code. Great means how perform your applications in production. Speed, How many Users uses your application..etc.. I think videos like this, tell nothing. There are so many ways to build good code. This is why i dont watch videos in this format. But i like your other videos ;)

    • @saaslaravel
      @saaslaravel  10 месяцев назад

      I agree, but cannot really name the video "one of the good ways to make quality code". It gotta be a hot take and my opinion >>> your opinion 😹

  • @takielias
    @takielias 9 месяцев назад

    @saaslaravel I can't find the code repo. Could you please check?

    • @saaslaravel
      @saaslaravel  9 месяцев назад

      Updated the description!