如何在 Laravel 模块中进行迁移?

Han*_*man 3 module laravel eloquent laravel-migrations

在我的 Laravel 项目中,我使用nwidart包来制作模块。现在我想deleted_at向现有模型添加列。我应该在我的模块中进行新的迁移。我怎样才能做到这一点?

这是包文档: https://nwidart.com/laravel-modules/v4/advanced-tools/artisan-commands

我想要这样的模块:

php artisan make:migration add_soft_deletes_to_user_table --table="users"

Maj*_*nia 7

尝试这个命令:

php artisan module:make-migration add_soft_deletes_to_users_table <ModuleName>
Run Code Online (Sandbox Code Playgroud)

然后不要忘记在模型上使用Illuminate\Database\Eloquent\SoftDeletes特征User

php artisan module:make-migration add_soft_deletes_to_users_table <ModuleName>
Run Code Online (Sandbox Code Playgroud)