Laravel Modules Demo: Make Your Project Modular

Поделиться
HTML-код
  • Опубликовано: 13 авг 2024
  • An experiment demo project, transforming a simple Laravel admin panel into a modular structure with the package Laravel Modules.
    Pull Request from the video: github.com/LaravelDaily/Larav...
    Laravel Modules package: github.com/nWidart/laravel-mo...
    Our QuickAdminPanel: quickadminpanel.com
    - - - - -
    Support the channel by checking out our products:
    - Enroll in my Laravel courses: laraveldaily.teachable.com
    - Try our Laravel QuickAdminPanel: bit.ly/quickadminpanel
    - Purchase my Livewire Kit: livewirekit.com
    - View Laravel Code Examples: laravelexamples.com
    - Subscribe to my weekly newsletter: bit.ly/laravel-newsletter
  • ХоббиХобби

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

  • @iWaxxy
    @iWaxxy 2 года назад +31

    Bro, I swear, every video you release is like you're reading my mind. I'm planning a new project where I will need exactly this. Thank you!

    • @LaravelDaily
      @LaravelDaily  2 года назад +10

      Perhaps I just release too many videos, and sometimes hit something valuable :)

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

      @@LaravelDaily That, or just I’m still learning a lot about Laravel and your videos just hit the right spot. Thank you again for your valuable work. And I promise as soon as I can I will get your paid courses. Much love, man!

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

      He's not your "Bro". Show some respect to the man

    • @p30mehrdad
      @p30mehrdad 2 года назад +2

      I am exact as you.
      Thanks LaravelDaily.

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

      @@Formula7Driver Bro, since when calling someone "bro" is disrespectful? 😂

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

    Great video. I'm using this package for an API I'm working on now and I really like it. I modified the configuration to generate lorisleiva/laravel-actions files too. Not a single controller in the project and all defined routes go direct to the Action. It's a fun project to work on.

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

      @paradiddley Modules + Laravel Actions seems like such a good combo. Any words of advice since you've started using it?

  • @rezasalammohamareh4370
    @rezasalammohamareh4370 2 года назад +12

    I think the main reason for using modular system should be reusability in other projects. for example a Comment module that written once and can be used in other projects only with a few small customizations.

  • @alexaverkiyev9099
    @alexaverkiyev9099 2 года назад +2

    Some providers / controllers / services could relate to multiple modules.
    I prefer separating controllers / models / services to different subfolders. Anyway in IDE you look for file, mostly searching with suffixes and it searches within whole project. I'd say its up to personal preference how to sort everything up within your app. I agree sometimes app grows big with 100+ db tables, hundreds of controllers and so on. But everything still can be sorted out within the purpose of the directory (Controllers, Models, etc).
    I'd rather avoid extra packages that don't help me much, but this is my personal opinion, somebody could find this package very helpful.

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

    as a Magento dev, this is a must package to install for me

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

    I was waiting this video since my note
    Many thanks

  • @user-mb2so1tg5u
    @user-mb2so1tg5u 2 года назад +8

    If we look into the PHP-performance statistics (in an average project), we will see, that 50-80% of the time spends to initialize the application (instantiating classes, autoloading and so on). So, If we autoload all the module classes this way, our project initialization will grow drastically... It negates all the pros about decomposing our application into logical "modules", unfortunatelly :(

    • @user-oi5ck9yz8f
      @user-oi5ck9yz8f 2 года назад +1

      There is a refactored version of modules on github with an improved cache. When the cache is enabled, it shows itself much better in performance (almost like a native laravel application). But it is still under development and created as part of the "laraneat" framework

    • @user-oi5ck9yz8f
      @user-oi5ck9yz8f 2 года назад

      links to github are blocked so I can't insert it here

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

    This would have been live saving for me a couple of months ago. Nevertheless, thanks, it's good to know for future

  • @1234matthewjohnson
    @1234matthewjohnson 2 года назад +1

    we used something like this in the past - we found a lot of packages do not understand it

  • @jayeshpatidar5069
    @jayeshpatidar5069 5 месяцев назад

    Can we create a package instead of modules? I mean a private package hosted on github. What are the benefits of using modules over packages in our opinion.

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

    Hi, This Package is Really Awesome . I am using Modules Approach in one Project But i noticed that lot of Laravel packages that doesn't support modules approach like laravel debugger not working with Modules approach

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

    Finally, thanks for the video!

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

    Does this approach effect the performance of the application? or is it the good way to handle medium to big level application development? Any other alternatives?

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

    Good idea! But im would to listen what kind of use this library in microservice architecture?
    Waiting for your answer. Thanks))

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

    Nice video and nice idea, but how to handle a feature which contains data or relation for two or more modules at the same time?

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

      You can also have "regular" models and files, it will be like "base" models, outside of modules

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

    I am looking for the module like this for long time since symfony 3 has the feature which is good for big developers team, thanks

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

    Great ! I have confusion that is when I will use vue or react then how will I manage js components into the module? Thank you and wait for your reply.

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

    Might be worth it for you to make your admin panel modular, sounds like it would probably be more appealing for people building a site with a big CRM

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

    nice how I can import and export module with button like post module etc. thanks

  • @sakthivel-kl1ws
    @sakthivel-kl1ws 2 года назад

    Hi , I have one question. Is it possible to prefix db tables name based module via model file ?

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

    Nice one 👍

  • @tasneemwahdan3618
    @tasneemwahdan3618 6 месяцев назад

    Thanks for this video.
    I work on a project and need to split features somehow to let clients add and remove the features and pay accordingly. Can I achieve this goal by using modules? Or this approach is useful for splitting and controlling development only?
    I will appreciate your advise 🙏 @Povilas Korop

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

      This is more for development. For feature enable/disable, probably Laravel Pennant is a better tool.

    • @tasneemwahdan3618
      @tasneemwahdan3618 6 месяцев назад

      @@LaravelDaily thanks a lot for your reply! I will search for it 👍

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

    Brother, do you have courses in which you explain how it works? I love the way you deliver information

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

      I don't have any further course, I think this video is enough, everything else is in the official documentation of the package. Not sure, what specific questions or problems you have?

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

      ​@@LaravelDaily You could not understand me, but you have a course titled How to Structure Laravel Projects Will this course help me to understand Modules in depth?

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

    hello sir i love your contenet i have been watching and learning. but today i found this video which we have been strugling with some problem in a long time. our system has been build with modular methode which is amazing. but now the whole system really loads slow. we have been trying everything and its still so slow. what can we do? we will apreciate your expert knowledge. thanks

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

      Without proper debugging, it's impossible to blindly guess why your system is slow, sorry.

  • @raimonds.L
    @raimonds.L 2 года назад

    All Models are modular? I have a couple: Application, Comment, Company, Country, etc. The list goes on.

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

    how do we use livewire in module pattern, confused?

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

    Thanks for the video!
    I’m thinking of using this approach in one of my projects but I’m a little bit concerned by the overhead it can add in terms of processing (I have to add many intermediate providers, config files, etc). Does it is negligible?

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

      Not sure, it depends on the project, probably, and more of a "try and you will see for yourself" scenario.

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

    Is there any advantage to using this package over artkonekt/concord?

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

    Great content as always. Could you make a video about Laravel multi-tenancy?

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

      Done quite a lot already, for example: ruclips.net/video/nCiNqboYFVQ/видео.html

  • @gustavoaeidt
    @gustavoaeidt 2 года назад +2

    YES YES YEEEEEEEEEEEESSSSSSSS

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

    hello @Laravel Daily, if we need to use a model/entity to another module then how we should approach?

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

      Read the docs of the package, I don't know all the answers, I'm not the creator of this package

  • @mohamedel-damarawy6595
    @mohamedel-damarawy6595 2 года назад

    Hello Povilas, I can’t seem to find a good document/ video for moving to Lumen from Laravel. Can you help with that?

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

    Thanks for the great video. I am going to use this package, but have one question. Where I can put off controllers and services in case when modules can communicate with each other? I thought it can be a separate module or in one of the modules that I using. Perhaps it can be situated in a module that has the main role in this interaction.

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

      You can still use the main Laravel structure s "core", in addition to modules.

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

      @@LaravelDaily Thanks, it makes sense

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

      I am using Events/Subscribers for communication between modules. It's cleaner and keeps the modules completely separate from each other.

  • @SEOng-gs7lj
    @SEOng-gs7lj 2 года назад

    what's the benefit of using modules vs packages? is there any tooling to reuse modules in other projects?

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

      It's not about other projects. It's about separating the current project into pieces.

    • @SEOng-gs7lj
      @SEOng-gs7lj 2 года назад +2

      ​@@LaravelDaily maybe the keyword here is "manage", what is the definition of manage? the github says "...manage your large Laravel app using modules". My definition will include adding and removing modules. As the folders are almost identical to packages, i guess, why modules? why not packages? I'm not being biased here, just curious because i break all my code into packages

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

      It's a totally personal preference. Packages are what works for you, modules are more convenient to others. From my experience, Modules are used on projects where bigger team is involved and different developers are responsible for their own module(s) and don't touch others.

    • @SEOng-gs7lj
      @SEOng-gs7lj 2 года назад

      @@LaravelDaily ok let me explore thanks

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

    How about the performance?

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

      Shouldn't be different, but I haven't measured.

    • @user-oi5ck9yz8f
      @user-oi5ck9yz8f 2 года назад +1

      default cache setting, caches scanned modules for 60 seconds. In production, you can lengthen this time to reduce performance overhead.

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

    Have you tested the Eloquent Relationships?

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

      Which ones? This video is not about eloquent relationships

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

    I don't know if I will be able to do that seems unnecessary

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

    Sir please add video that how Laravel module work with inertiaJS with common layout in all module.

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

      I haven't used this package with Inertia, so can't make a video about it.

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

      @@LaravelDaily Ok thanks no problem . My whole if will not SPA.it will hard load when switching from one module to another.layout will also repeat in each module. internally each module will SPA.

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

    Can you make a video about DDD?
    Domain Driven Development

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

      Yes it's in plans, some time later in 2021

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

    How do you quickly create all these projects

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

      It's my full time job. And I have a few teammates who can help.

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

    Hello sir
    Please why don’t you create a course about
    React js basics and authentication with laravel and with laravel api crud

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

      For now, I have other topics in plans: www.filepicker.io/api/file/P5aTpAaR92LK38fD8xYo
      But maybe in the future.
      That said, React isn't very popular in the Laravel community (Vue is much more popular), so not sure how many people would be actually interested in such a course.

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

      @@LaravelDaily do you have plan to upgrade your course about vue js
      Because till now it doesn’t contain
      login/auth/role / permissions, and Vuex for state management.
      Best regards

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

      Didn't plan to do it, but probably a good idea. Will add to my schedule, but probably for 2022.

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

    Interesting

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

    i prefer to use DDD rather than use MVC and make it modular, it's much better

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

    its not better to use microservices?

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

    I move to laravel cause this package (laravel modules)

  • @ricko13
    @ricko13 2 года назад +2

    oh no, it looks complicated :s

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

      If it's complicated, then your projects probably don't need it.

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

      @@LaravelDaily yeah amen

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

      @@LaravelDaily if it's complicated then it's not written very well. Complicated code != to good readable and maintainable code. The module approach also results in a fragmented code base, as there are now multiple places to update / manage routes, controllers, models etc.

    • @nicolas_vl
      @nicolas_vl 2 года назад +2

      @@johnp6115 I can say that it depends on what suits you. I've developed a big ERP system. Its core is the same for every client. But for some other I'm either removing or adding functionality. Every module has the same structure. When you need to update something you know where to search, you work on one module at a time. Managing routes from one place can be hard when you have 140-160 routes (GET, POST, etc) for handling everything. In my situation I don't use this package, I have written my own solution which bootstraps every module, migrations and the service provider for it. But the approach is practical. And I'd call it the whole thing "functional components", cause when a module has an eloquent relationship to an other module, the idea of modularity is kinda gone. Cheers