1. Module adder install by composer
composer require nwidart/laravel-modules

2. Publish vendor

php artisan vendor:publish --provider="Nwidart\Modules\LaravelModulesServiceProvider"

3. Add “Modules” folder to composer.json autoload

"autoload": {
"psr-4": {
"App\\": "app/",
"Modules\\": "Modules/",

4. composer dump-autoload

5. Create module by command

php artisan module:make <module-name>

Now check module and route. Thats it.

— Shah Md. Iktakhirul Islam, Software Engineer.

Contact Number: +8801683201359

Email: iktakhairul@gmail.com

GitHub Profile: https://github.com/iktakhairul



Just read, understand, copy those code and replace by your variables and fields it should work correctly. Don’t scared of those codes, most of them are for presenting data with professional way.

If you don’t understand just contact with me with email or phone.

Controller Index Function: Pass request to our functions and returning data with collection. You can return without collection also.

Step1: Passing all request to findBy function.

2. FindBy Function: Here we pass data to main method and organize data.