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 - Хобби
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!
Perhaps I just release too many videos, and sometimes hit something valuable :)
@@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!
He's not your "Bro". Show some respect to the man
I am exact as you.
Thanks LaravelDaily.
@@Formula7Driver Bro, since when calling someone "bro" is disrespectful? 😂
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.
@paradiddley Modules + Laravel Actions seems like such a good combo. Any words of advice since you've started using it?
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.
yes, exactly
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.
as a Magento dev, this is a must package to install for me
I was waiting this video since my note
Many thanks
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 :(
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
links to github are blocked so I can't insert it here
This would have been live saving for me a couple of months ago. Nevertheless, thanks, it's good to know for future
we used something like this in the past - we found a lot of packages do not understand it
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.
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
Finally, thanks for the video!
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?
Good idea! But im would to listen what kind of use this library in microservice architecture?
Waiting for your answer. Thanks))
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?
You can also have "regular" models and files, it will be like "base" models, outside of modules
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
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.
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
nice how I can import and export module with button like post module etc. thanks
Hi , I have one question. Is it possible to prefix db tables name based module via model file ?
Nice one 👍
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
This is more for development. For feature enable/disable, probably Laravel Pennant is a better tool.
@@LaravelDaily thanks a lot for your reply! I will search for it 👍
Brother, do you have courses in which you explain how it works? I love the way you deliver information
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?
@@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?
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
Without proper debugging, it's impossible to blindly guess why your system is slow, sorry.
All Models are modular? I have a couple: Application, Comment, Company, Country, etc. The list goes on.
how do we use livewire in module pattern, confused?
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?
Not sure, it depends on the project, probably, and more of a "try and you will see for yourself" scenario.
Is there any advantage to using this package over artkonekt/concord?
Great content as always. Could you make a video about Laravel multi-tenancy?
Done quite a lot already, for example: ruclips.net/video/nCiNqboYFVQ/видео.html
YES YES YEEEEEEEEEEEESSSSSSSS
hello @Laravel Daily, if we need to use a model/entity to another module then how we should approach?
Read the docs of the package, I don't know all the answers, I'm not the creator of this package
Hello Povilas, I can’t seem to find a good document/ video for moving to Lumen from Laravel. Can you help with that?
Use laravelshift com
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.
You can still use the main Laravel structure s "core", in addition to modules.
@@LaravelDaily Thanks, it makes sense
I am using Events/Subscribers for communication between modules. It's cleaner and keeps the modules completely separate from each other.
what's the benefit of using modules vs packages? is there any tooling to reuse modules in other projects?
It's not about other projects. It's about separating the current project into pieces.
@@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
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.
@@LaravelDaily ok let me explore thanks
How about the performance?
Shouldn't be different, but I haven't measured.
default cache setting, caches scanned modules for 60 seconds. In production, you can lengthen this time to reduce performance overhead.
Have you tested the Eloquent Relationships?
Which ones? This video is not about eloquent relationships
I don't know if I will be able to do that seems unnecessary
Sir please add video that how Laravel module work with inertiaJS with common layout in all module.
I haven't used this package with Inertia, so can't make a video about it.
@@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.
Can you make a video about DDD?
Domain Driven Development
Yes it's in plans, some time later in 2021
How do you quickly create all these projects
It's my full time job. And I have a few teammates who can help.
Hello sir
Please why don’t you create a course about
React js basics and authentication with laravel and with laravel api crud
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.
@@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
Didn't plan to do it, but probably a good idea. Will add to my schedule, but probably for 2022.
Interesting
i prefer to use DDD rather than use MVC and make it modular, it's much better
its not better to use microservices?
I move to laravel cause this package (laravel modules)
oh no, it looks complicated :s
If it's complicated, then your projects probably don't need it.
@@LaravelDaily yeah amen
@@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.
@@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