Several commonly used operation commands:
1. Create a module: php artisan module:make <module-name>
php artisan module:make Admin
2. Create a data table:
php artisan make:migration create_posts_table --create=posts
或
php artisan module:make-migration create_posts_table Admin
注:表名称使用复数形式
3. Migrate data table:
php artisan migrate
4. Create a controller: php artisan module:make-controller <controller-name> <module-name>
php artisan module:make-controller Post Admin
5. Create a model: php artisan module:make-model <model-name> <module-name>
php artisan module:make-model Post Admin
6. Create a middleware: php artisan make:middleware <middleware-name> or php artisan module:make-middleware <middleware-name> <module-name>
php artisan make:middleware AdminAuth
或
php artisan module:make-middleware AdminAuth Admin
7. Add user field file:
php artisan make:migration add_intro_to_users_table --table=users
Related documents: