Artisan 是 Laravel 自带的命令行接口,它为我们在开发过程中提供了很多有用的命令。想要查看所有可用的 Artisan 命令,可使用 list 命令:
php artisan list
每个命令都可以用 help 指令显示命令描述及命令参数和选项。想要查看帮助界面,只需要在命令前加上 help 就可以了:
php artisan help migrate
php artisan make:controller StudentController
php artisan make:model Http/Models/Student
php artisan make:middleware Activity
//生成登录模块
php artisan make:auth
php artisan migrate
//会报错
Migration table created successfully.
In Connection.php line 664:
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes (SQL: alter table
`users` add unique `users_email_unique`(`email`))
In Connection.php line 458:
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes
//解决办法:
use Illuminate\Support\Facades\Schema;
//设置默认字符串长度
Schema::defaultStringLength(191);