Laravel Design Patterns: Strategy with Services Example

Поделиться
HTML-код
  • Опубликовано: 24 окт 2024

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

  • @AbdulMoizDev
    @AbdulMoizDev 2 месяца назад +4

    I started using the service classes pattern by watching your video and it really helped me to organise the code and increase code reusability

  • @zakariajawas
    @zakariajawas 2 месяца назад +1

    Great as usual, thank you

  • @ryiad2010
    @ryiad2010 2 месяца назад

    very useful thank you

  • @loremipsum-tk2pu
    @loremipsum-tk2pu 2 месяца назад +3

    Is there a reason to bring in the services through typehinting them? In my case, I don't need an instance of the service so I make all my service methods static and use it like you would use a facade.

    • @LaravelDaily
      @LaravelDaily  2 месяца назад +2

      Both are possible, personal preference in most cases.

    • @ParadoxKarl44
      @ParadoxKarl44 2 месяца назад +1

      The main reason to use dependancy injection over static methods is that it's significantly easier to test (using static methods makes it difficult to manipulate and mock sub-dependancies). Facades do have some built in functionality that somewhat mitigates these difficulties.

  • @rehmanghani6726
    @rehmanghani6726 2 месяца назад +1

    Nice video ❤

  • @eslammostafa1247
    @eslammostafa1247 2 месяца назад

    Hello mr Povilas, do you have a tutorial on Laravel daily covering caching somehow in-depth?

    • @LaravelDaily
      @LaravelDaily  2 месяца назад +1

      Depends on what kind of caching, we have these tutorials about it: laraveldaily.com/tag/cache?source=search

    • @eslammostafa1247
      @eslammostafa1247 2 месяца назад

      @@LaravelDaily Thank you :)

  • @iconicae8814
    @iconicae8814 2 месяца назад +1

    I wonder if i make the paypal integration or the facebook or twitter integration , how should the people working with me use this feature although it's linked by my credentials in the env file for example?

    • @LaravelDaily
      @LaravelDaily  2 месяца назад +2

      Depends on the API of specific tool, but usually they should set up specific testing credentials to put on their env file and/or staging.

    • @iconicae8814
      @iconicae8814 2 месяца назад +1

      @@LaravelDaily thanks so much sir

  • @muhibahmed1116
    @muhibahmed1116 2 месяца назад

    Nice

  • @codesmiles_
    @codesmiles_ 2 месяца назад

    My boss like to use the word providers for external services and services for handling business logic

    • @LaravelDaily
      @LaravelDaily  2 месяца назад +2

      Service PROVIDER is another misunderstood word. A video about that one is also coming.

  • @k.surendhar964
    @k.surendhar964 2 месяца назад

    ❤❤❤

  • @kirayamato6128
    @kirayamato6128 2 месяца назад

    why use interface to the invoke? i don't understand why?? care to explain? this is new to me. for what I've experienced interface should use as implements, right?

    • @LaravelDaily
      @LaravelDaily  2 месяца назад +1

      Not sure which part you didn't understand, maybe the full course would explain it to you?
      So yeah, interface is the set of rules, two classes implement that interface, then the controller accepts the interface as parameter, and then service provider decided which class is chosen from that interface classes.

  • @wowdesigns7436
    @wowdesigns7436 2 месяца назад +1

    🤦‍♂😁 Noticing outdated Chrome in your tutorial! Isn't it bothering you? Just update Chrome already! 🤷‍♂

    • @LaravelDaily
      @LaravelDaily  2 месяца назад +4

      No, not bothering me. I have more important stuff to think about.