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"
尝试这个命令:
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)
| 归档时间: |
|
| 查看次数: |
12990 次 |
| 最近记录: |