GrafiteInc / CMS

Decoupled CMS for any Laravel app, gain control of: pages, blogs, galleries, events, images, custom modules and more.

Home Page:https://cms.grafite.ca

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CRUD migration file not created

khyoz opened this issue · comments

commented

Describe the bug
php artisan module:crud Toto

To Reproduce
Steps to reproduce the behavior:

  1. cmd
  2. execute php artisan module:crud Toto

Expected behavior
The migration file is not created, the subdirectory database/migrations does not exist or is not created
Illuminate\Filesystem\Filesystem::put("D:\MAMP\htdocs\project/cms/Modules/Totos/Publishes/database/migrations/2018_09_13_181602_create_totos_table.php", "

Screenshots
crud2

Solution
create manually the subdirectory database/migrations, delete route generated for the module otherwise, content is duplicated with syntax error, and rerun the command Crud, then it works, migration file is created

Desktop (please complete the following information):

  • Windows 10 Laravel 5.7 Last version Grafite, Mamp Pro 4, Php 7.1.7, cmd mode

Additional context
Add any other context about the problem here.

The module is being generated, but you're missing a couple steps. First creating the module makes it a local copy, you can then run the command artisan module:package to transform it into a packagist package, but lets assume you want to just keep it local. You can run the command artisan module:publish Totos to publish things like the migrations etc to your application where you can then run the migrations, this is also how you will get the routes file to be found.

Also if you want the module to automatically handle the migrations, you can add that to the module provider $this->loadMigrationsFrom(__DIR__.'/Migrations');

commented

I did retry with php artisan module:crud to create a new module and everything was there.
Now I understand I did try to follow commands and documentation and here are steps to reproduce the same error

  1. php artisan module:make X1 (First I want to create a module)
  2. php artisan module:crud X1 (Now I want to generate crud)

and you will see the migration is not created and you catch the exception

These are two separate commands that are not required to go together, they generate two different module types.