Как следует из названия; есть ли способ удалить/откатить/откатить создание файлов, созданных при запуске php artisan make:model MyModel -mcr
?
Что-то типа:
php artisan destroy:model MyModel
.. и он "каскадно" удаляет все связанные файлы?
Когда вы бежите
php artisan make:model --help
команда, которую вы должны увидеть
Usage:
make:model [options] [--] <name>
Arguments:
name The name of the class
Options:
-a, --all Generate a migration, factory, and resource controller for the model
-c, --controller Create a new controller for the model
-f, --factory Create a new factory for the model
--force Create the class even if the model already exists
-m, --migration Create a new migration file for the model
-p, --pivot Indicates if the generated model should be a custom intermediate table model
-r, --resource Indicates if the generated controller should be a resource controller
-h, --help Display this help message
-q, --quiet Do not output any message
-V, --version Display this application version
--ansi Force ANSI output
--no-ansi Disable ANSI output
-n, --no-interaction Do not ask any interactive question
--env[=ENV] The environment the command should run under
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose outp
ut and 3 for debug
Это означает, что по умолчанию это невозможно. Вы должны сделать для этого свою собственную ремесленную команду. Также, если вы хотите узнать о параметрах и аргументах команды artisan, используйте
php artisan command_name --help
Просто сделайте это вручную, на момент написания этой команды нет
...database/migrations
php artisan migrate
, войдите в свой phpmyadmin или SQL (в зависимости от того, в каком случае) и в своей базе данных удалите таблицу, созданную миграцией.У меня работает, надеюсь поможет!