CRUD migration file not created
khyoz opened this issue · comments
Describe the bug
php artisan module:crud Toto
To Reproduce
Steps to reproduce the behavior:
- cmd
- 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", "
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');
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
- php artisan module:make X1 (First I want to create a module)
- 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.