创建一个新laravel项目,其中zhihu-app是项目名称也是项目目录
截止目前laravel项目默人为5.5.* php要求7.1以上
laravel new zhihu-app
如果你想指定laravel版本请用下列方式安装
composer create-project laravel/laravel zhihu-app 5.5.*
进入database/migrations/ create_users_table 文件
修改up方法
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->string('name')->unique();
$table->string('email')->unique();
$table->string('password');
$table->string('avator');
$table->string('confirmation_token');
$table->smallInteger('is_active')->default(0);
$table->integer('questions_count')->default(0);
$table->integer('answers_count')->default(0);
$table->integer('comments_count')->default(0);
$table->integer('favorites_count')->default(0);
$table->integer('likes_count')->default(0);
$table->integer('followers_count')->default(0);
$table->integer('followings_count')->default(0);
$table->json('settings')->nullable();
$table->rememberToken();
$table->timestamps();
});
}
执行migrate命令
php artisan migrate
修改 config/app.php文件的timezone为PRC
执行命令创建用户注册登录脚手架
php artisan make:auth
使用sendcloud发送用户email
到https://github.com/NauxLiu/Laravel-SendCloud 按照说明进行安装下载
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有