Wednesday, January 1, 2020

Laravel Module (nwidart/laravel-modules) package Artisan command

Step:01

#To install through Composer, by run the following command:
  • composer require nwidart/laravel-modules
  • php artisan vendor:publish --provider="Nwidart\Modules\LaravelModulesServiceProvider"

Step:02

#By default the module classes are not loaded automatically. You can autoload your modules using psr-4. For example :
{
  "autoload": {
    "psr-4": {
      "App\\": "app/",
      "Modules\\": "Modules/"
    }
  }
}

Step:03

#Tip: don't forget to run composer dump-autoload afterwards


Step:04

Module Artisan Command:
  • php artisan module:make Blog
  • php artisan module:make-migration create_posts_table Blog
  • php artisan module:migrate Blog 
  • php artisan module:seed Blog
  • php artisan module:make-controller PostsController Blog
  • php artisan module:make-model Post Blog
  • php artisan module:make-provider BlogServiceProvider Blog
  • php artisan module:make-request CreatePostRequest Blog

No comments:

Post a Comment

Ajax load lage with laravel.

 step-1:  HTML <div class="row">                     <div class="col-lg-12">                           <d...