Laravel 6 Advanced - e7 - Repository Pattern

Поделиться
HTML-код
  • Опубликовано: 8 сен 2019
  • The Repository Pattern is a common refactor that you may encounter in large Laravel applications. While it is not ideal for small to medium projects, it's a perfect solution for those applications that need an abstraction of the data layer.
    For the best experience, follow along in our interactive school at www.coderstape.com
    DigitalOcean Referral
    m.do.co/c/7dce5364ef4d
    Hit us up on Twitter with any questions or comments @codertape ( / coderstape )
    About This Course
    Ready to level up your Laravel skills? This series is for you, follow along as we uncover the advanced Laravel features that actually make Laravel the most popular php framework. We'll have lot of tips and tricks along the way. Are you ready?

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

  • @morleytechtv7749
    @morleytechtv7749 4 года назад +87

    this is crazy dude. hope you have good health to create more videos. I learn a lot from your videos.

  • @andynguyen8124
    @andynguyen8124 4 года назад +19

    Dude, that map->format(); is genius, Wow
    Also I've never know that we can ->diffForHumans() from carbon, thanks so much

  • @phentube2345
    @phentube2345 4 года назад +6

    where were you, finally I found someone that knows pure implementation and architecture.

  • @victorwillhuber
    @victorwillhuber 2 года назад +1

    Man, I watch A LOT of educational videos on coding (php, js, laravel, vue) and you are the best.

  • @abunooh9005
    @abunooh9005 4 года назад +11

    I never comment on anything, but this series is just too helpful. You are my new Laravel teacher. Keep it up and thank you very much. You are awesome!

  • @kasmanialisaad
    @kasmanialisaad 4 года назад +52

    These advanced series are very helpful. Thanks!

    • @CodersTape
      @CodersTape  4 года назад +9

      Happy to hear that. More advanced topics are much more time consuming in preparation leading up to recording the lesson.

    • @julienSibille
      @julienSibille 4 года назад +1

      @@CodersTape Thanks for your work Victor, what about another Udemy course applying those advanced concept ?

    • @priteshshinde6779
      @priteshshinde6779 4 года назад +1

      We understand that it is more time consuming, but you know you've got 1 more subscriber just now (me).
      I'm sure you'll get alot more subscribers until this series end, but please make more videos.

  • @CircuitMoe
    @CircuitMoe 2 года назад +3

    your practical explanation is phenomenal. Keep up the good work please, people like us depend on you.

  • @paolopalubs64
    @paolopalubs64 4 года назад

    Very informative! I've been using using model repositories for a long time now, and this is a good tutorial for those who haven't tried it yet. This is useful specially when doing reports.

  • @fabianleon1744
    @fabianleon1744 4 года назад

    Thank you very much for these videos 🙌. I have read many times about the repository pattern, but this is by far the best explanation I have found.

  • @Brianle180
    @Brianle180 4 года назад +1

    Just totally love all your tutorials. Keep it up.

  • @aristideherve5748
    @aristideherve5748 4 года назад

    You are incredible ! I asked for a video on it in your last video and you did it. Everything is clear ans precise. God bless you!

  • @ssjuma
    @ssjuma 3 года назад

    Interface implementation was my best part, loved it!

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

    Crazy good content, thanks a lot for posting this. The quality of this video is unreal. God bless you man!!

  • @mohammedmahmoud1182
    @mohammedmahmoud1182 3 года назад +1

    The best coding channel out there. I hope you post more videos as you used to.

  • @maharagab5107
    @maharagab5107 4 года назад

    Very helpful , I was waiting for it thank you so much, really appreciate all the valuable content you provided thanks again!

  • @peymanGhaderkurehpaz
    @peymanGhaderkurehpaz 4 года назад

    That was awesome , thanks , these Advanced video series are awesome .

  • @phoe7ix
    @phoe7ix 4 года назад

    An extremely useful lesson, thank you, Victor!

  • @TUTORIALSUZ
    @TUTORIALSUZ 4 года назад

    Thank you, bro!!! You are awesome! I learnt everything I'm confused. Thank you for your lessons. Sincerely, Sanjarbek from Uzbekistan.

  • @mori181186
    @mori181186 4 года назад

    This is why i love Laravel. Thanks for your good videos :)

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

    I never not like every single video i watched from this dude. Thanks a lot bro.

  • @yurabobrov6717
    @yurabobrov6717 4 года назад +1

    If I could to press "Like" twice, I would do it! Awesome tutorial as always.

  • @xdEdgarBest
    @xdEdgarBest 4 года назад

    Your videos are simply the best, thank you

  • @milantarami
    @milantarami 4 года назад

    Learning more advanced things in this advanced laravel series, out of the box :) .... Need a tutorial on Service Pattern implementation

  • @Stoney_Eagle
    @Stoney_Eagle 4 года назад +4

    I will definitely implement the format function, I feel like I've been repeating myself a lot on database queries. Thanks!

  • @ammaralhomyqani9079
    @ammaralhomyqani9079 2 года назад

    Thank u so much, we need people like you in this world

  • @colonelvector
    @colonelvector 4 года назад

    Excellent explanation, grasped it immediately.

  • @KistlakRajapakshaSevenNet
    @KistlakRajapakshaSevenNet 4 года назад +2

    100% Perfect !!
    Thank You very Much Bro !! :D

  • @AirMalta89
    @AirMalta89 4 года назад +15

    This course is amazing. Not the usual blah-blah most good laravel devs already know. But really insightful, solving real-life problems where you were thinking as a dev, there should be a nicer solution for this!

  • @MustafaBirsoz
    @MustafaBirsoz 3 года назад +1

    I love your tone and the content here

  • @mohamedtalaat8945
    @mohamedtalaat8945 4 года назад

    Thanks for this great episode!

  • @asdf7972
    @asdf7972 4 года назад +1

    Mannn i really love this course!!!

  • @peymanGhaderkurehpaz
    @peymanGhaderkurehpaz 4 года назад +1

    awesome , can you make more videos like this ? implementing design patterns and advanced php and laravel technics are awesome . Thanks again

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

    Very well explained. Useful content.

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

    that's greate, greate series, greate demonstrations and easy to understand, thanks man :))))

  • @shaheerarain50
    @shaheerarain50 3 года назад

    I was smiling while watching your video and thinks how a person could be so good at ♥️
    Thank you

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

    thanks for creating such amazing video , i really love the way u clear concept in depth .

  • @MrAlaa3344
    @MrAlaa3344 3 года назад

    you're the best ever in explaining leravel

  • @rahulshimpi8914
    @rahulshimpi8914 4 года назад +1

    Great great video please make more advance video. You are really professional programmer.

  • @anoopsankar7726
    @anoopsankar7726 3 года назад

    This is very useful. I learnt a lot. Thanks for the video.

  • @golubevblog2279
    @golubevblog2279 4 года назад

    WONDERFUL DUDE! KEEP GOING! U'RE A MAN!

  • @adam192021
    @adam192021 4 года назад

    The BEST as always!

  • @TolvirRam
    @TolvirRam 3 года назад

    Thanks a lot. Finally I understand repositories :))

  • @rolanddecasa4438
    @rolanddecasa4438 3 года назад

    Another good one! Keep it up bro! God bless you

  • @carlosmillanmazzucco1766
    @carlosmillanmazzucco1766 3 года назад

    My god dude! thanks so much!! this video clarified me a lot of things. Love ur channel and content! cheers

  • @Darren502
    @Darren502 4 года назад +1

    This is a great ep. Thx for showing us this. Would you make a video on caching?

  • @mubashirali5687
    @mubashirali5687 2 года назад

    Great explanation about repository pattern :-)

  • @mohaimenkhalid3844
    @mohaimenkhalid3844 3 года назад

    just a awesome video bro!! thanks a lot bro

  • @ProgrammingwithPeter
    @ProgrammingwithPeter 4 года назад +2

    Cool, unfortunately beginners take Repository as granted, glad that you pointed out that it is meant for larger apps!

  • @MarcoAZeballosS
    @MarcoAZeballosS 4 года назад

    It's the first time I get to clearly understand Repositories.
    I cannot pass to the next video without congratulating you and thanking you for such amazing video/explanation.
    👏🏼👏🏼👏🏼

    • @CodersTape
      @CodersTape  4 года назад

      Thanks

    • @user-zf1pl6wj4n
      @user-zf1pl6wj4n 6 месяцев назад

      well, you are still not, because repo pattern is not needed when using laravel

  • @carlosolivas2878
    @carlosolivas2878 4 года назад

    it is a very nice course, thanks!

  • @utshabroy
    @utshabroy 4 года назад +4

    Thanks you for this video. I learned a lot.
    However, I read some blog where the Repository is connected with the ServiceLayer. If I'm right then can you please make a video on how Repository and ServiceLayer works together on big projects.
    Thank you again 😊 you are the best Laravel tutor.

  • @nullpadshot
    @nullpadshot 4 года назад +2

    Collection()->map->formatCallback()? and you dont kidding? Freakin awesome! That save me at least 1000 rows of code! Awesome! Thank you so much!

  • @ahmadmayahi
    @ahmadmayahi 3 года назад +6

    The repository should only be used to reterive the data.
    It's a common mistake that some developers use repositories for storing/updating/deleting, but it’s not meant to be like that.
    If you need to store/update/delete then you have to have a persistent layer.
    I think Doctrine did the best implementaion of repositories.

    • @dr.adam.nielsen
      @dr.adam.nielsen 3 года назад +2

      In literature you find that the main purpose of repositories is to be a layer between your data mapping and the business logic. Its totally fine to store/update/delete date there. See stackoverflow.com/questions/57340681/should-we-save-update-models-in-repository-pattern

    • @user-zf1pl6wj4n
      @user-zf1pl6wj4n 5 месяцев назад

      So what are we supposed to use instead of repos?

  • @develvir
    @develvir 4 года назад

    Thank you very much for this tutorial

  • @ariasalmeida
    @ariasalmeida 4 года назад

    Thank you !! very clear !

  • @irfanullahshakir3568
    @irfanullahshakir3568 4 года назад

    Outstanding, thank u!

  • @jeck0898
    @jeck0898 4 года назад

    Thanks so much for this tutorial

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

    Wow! This is amazing! You are a god!

  • @mohd.aadilads3889
    @mohd.aadilads3889 9 месяцев назад

    Very good explanation 🎉🎉

  • @Yuri-sf5mx
    @Yuri-sf5mx 4 года назад +2

    Watched this video to fresh up my memory on repositories and honestly you make great videos and your explanation is to the point. Love your style. On the subject though i do find that the only reason you should use repositories is when you expect to swap out your database for something else. Other than that i stick with model query scopes for the repetitive query's (powerfull for their chainability) and use resources to format them. Even on very large projects. You could still use repositories in combination with these, but as said, the only added value is data driver independency.
    *Edit*
    Looks like this has been said a few times. Either way, it boils down to project requirements and personal favor. There is no "right" way.

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

    Quick note. You bind interfaces in register() method of the service provider

  • @jhonata13souza
    @jhonata13souza 3 года назад

    very nice, thanks!!

  • @SunilparajuliKenshin
    @SunilparajuliKenshin 4 года назад

    This is the best quality content coding pattern

  • @emmanuelmichael5314
    @emmanuelmichael5314 2 года назад

    wow! thanks a lot man!

  • @user-bn4gg1qt4b
    @user-bn4gg1qt4b 3 года назад

    I enjoyed it. thanks

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

    Thank you so much!

  • @richardjustinesoriano304
    @richardjustinesoriano304 3 года назад

    Thank you! 😄

  • @THEShAdOwHFV
    @THEShAdOwHFV 4 месяца назад

    Min 21:00
    For those that can't load the provider when registering it in app.php file (test the provider with dd("plainText"))
    You can do:
    php artisan config:clear
    php artisan clear-compiled
    composer dump-autoload
    If composer is failing, just delete the "dd("test")" in your provider

  • @saeidehmonfared8257
    @saeidehmonfared8257 4 года назад

    Thanks so much , just keep going :)

  • @oghenerukevwekofi7976
    @oghenerukevwekofi7976 4 года назад

    I think repositories are also beneficial for testing. When you have the data layer coded against an interface like this, it becomes easier to mock it while testing. Depending on your needs, I think you might want to be able to separate tests that will reach the database from tests that just see if your basic functionality is working or not.

  • @irfanullahshakir3568
    @irfanullahshakir3568 4 года назад

    Outstanding

  • @adaamgbede283
    @adaamgbede283 3 года назад

    Nice video. I really learn a lot. I wonder why people gave this a thumb down

  • @ahmadmayahi
    @ahmadmayahi 3 года назад +3

    12:19 You can avoid mixing transformers into repositories by using an external transformer.
    In this case, the fractal package would be amazing to use.

    • @KuroUsagi1010
      @KuroUsagi1010 2 года назад

      May I ask where they are going to be called when formatting? should it be on the controller? or on the repository?

  • @sofiatopalidi9403
    @sofiatopalidi9403 4 года назад

    Thank you 👍

  • @sardinas3675
    @sardinas3675 4 года назад +4

    This is fr**king awesome my friend! I hope that someday or in the future that you will create a video on SOLID pattern in laravel. Btw You are the best

  • @vimkndll4171
    @vimkndll4171 4 года назад

    mind blowing video I have ever seen in the youtube

  • @yuchenglong672
    @yuchenglong672 4 года назад

    I think for those who don't potentially change their projects databases, a cleaner way is to implement a eloquent based repository design pattern, that works specifically with laravel eloquent, and just so much cleaner and readable. For a large projects which may be deployed with different types of dbs, a middle layer like the repository interface design pattern is almost like a must go-to idea.

  • @SamehNabilAhmed
    @SamehNabilAhmed 4 года назад +2

    you are awesome dude

  • @ajomehri
    @ajomehri 2 года назад

    Tnx alot.. so helpfull

  • @Laflamablanca969
    @Laflamablanca969 4 года назад +1

    I find formatting with Resources is much more flexible

  • @mahmoudalajajalarar5552
    @mahmoudalajajalarar5552 4 года назад

    out of the box :)

  • @claremontsystems4255
    @claremontsystems4255 3 года назад

    brilliant !

  • @haki3018
    @haki3018 3 года назад

    using request() in repository very nice

  • @limuelmendoza5356
    @limuelmendoza5356 3 года назад

    i hope i've seen your channel before my project... life shouldve been way easier

  • @shirjeelkhan
    @shirjeelkhan 4 года назад

    Great work...please go ahead. When is the next one e8 ?

  • @hassanalthaf8561
    @hassanalthaf8561 4 года назад +1

    I would honestly keep that format method within the Repository, as when you're writing a new concrete implementation of the repository, you might miss out on that specific business rule.

  • @dilipdev8699
    @dilipdev8699 2 года назад +1

    Really amazing!. What about next point after implementation the interface?. Even without the interface we can do the same things. Then what's the purpose of the interface here?.

  • @ibrahimhassan4168
    @ibrahimhassan4168 3 года назад

    Amazing

  • @markmacapagal29
    @markmacapagal29 4 года назад

    Hmm. . . Im still learning thanks bro...

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

    hi there, it's been long that you haven't published a video, I love your content, please start making videos again :)

  • @melomancheto2761
    @melomancheto2761 3 года назад

    I do not agree on the part of format and transform. You can't choose format, formating is for dates for examples. What we are doing with this data is transforming it . But the tutorial and not only this one, all of them are awesome!! Keep up the great content.
    Something else is that the request has nothing to do with the Repository. The repo is just a middle layer between the database and the Controller (I use this example to be more close to Laravel).
    We need to pass all the data we need as params and never pass the Request outside of the Controller.

  • @amirkaftari5188
    @amirkaftari5188 3 года назад

    dude come back and create amazing tutorials for us.

  • @robert5488
    @robert5488 4 года назад

    Thanks very much for these videos! They are brilliant, concise and very clear. Better than Laracasts. Would love to see more videos on design patterns and clean code fundamentals.

  • @ristekostadinov2820
    @ristekostadinov2820 4 года назад

    If more than one class implements the CustomerRepository then in boot method of the provider we should register both of them (the interface with the first class and the interface with the second class) ? For example you can implement the interface with 2 classes one with pure eloquent ORM and second class with query builder

  • @jobayertuser
    @jobayertuser 3 года назад

    bro it's so cool

  • @stefanosgiannakis7151
    @stefanosgiannakis7151 4 года назад

    You are perfect 👌

  • @NathanBudd
    @NathanBudd 4 года назад

    Would love a video on Lazy Collections 👍

  • @Brianle180
    @Brianle180 4 года назад

    I am wondering that in this case, what is correct when we put the interface’s binding in ‘boot’ or ‘register’ function?

  • @lopotovsky
    @lopotovsky 4 года назад

    Thank's

  • @fatihkobacik
    @fatihkobacik 4 года назад

    Thanks for sharing. This repostories like Helper, are we use without construct
    Like "use App/Repostories/TestRepostory"
    I was use like this, some 5.x version in laravel