惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

G
Google Developers Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
量子位
C
Check Point Blog
B
Blog RSS Feed
Y
Y Combinator Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
A
About on SuperTechFans
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - 聂微东
阮一峰的网络日志
阮一峰的网络日志
人人都是产品经理
人人都是产品经理
小众软件
小众软件
Last Week in AI
Last Week in AI
博客园 - 【当耐特】
GbyAI
GbyAI
The Cloudflare Blog
博客园 - 叶小钗
S
SegmentFault 最新的问题
博客园 - Franky
Engineering at Meta
Engineering at Meta
F
Fortinet All Blogs
B
Blog
Jina AI
Jina AI

mafeifan 的编程技术分享

mafengwo-mp3-downloader | mafeifan 的编程技术分享 示例页面 | mafeifan 的编程技术分享 mafeifan 的编程技术分享 mafeifan 的编程技术分享 mafeifan 的编程技术分享 mafeifan 的编程技术分享 mafeifan 的编程技术分享 mafeifan 的编程技术分享 mafeifan 的编程技术分享 mafeifan 的编程技术分享 mafeifan 的编程技术分享 查看 default namespace 下的 default service account名称 mafeifan 的编程技术分享 检查日志 | mafeifan 的编程技术分享 bridge fdb show dev flannel.1 mafeifan 的编程技术分享 mafeifan 的编程技术分享 mafeifan 的编程技术分享 mafeifan 的编程技术分享 mafeifan 的编程技术分享 mafeifan 的编程技术分享 mafeifan 的编程技术分享 mafeifan 的编程技术分享 mafeifan 的编程技术分享 mafeifan 的编程技术分享 mafeifan 的编程技术分享 mafeifan 的编程技术分享 mafeifan 的编程技术分享 mafeifan 的编程技术分享 mafeifan 的编程技术分享
mafeifan 的编程技术分享
2026-01-16 · via mafeifan 的编程技术分享

本节新建一个全新的laravel5.4项目及为user表添加一些字段

  1. 新建laravel项目 laravel new zhihu-app

  2. 配置.env,主要改下数据库连接信息

  3. 配置vhost,如果用的homestead,可能还要改他的配置文件

  4. 修改user表 打开 2014_10_12_000000_create_users_table.php 添加一些字段

  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('avatar');
      // 激活token
      $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->string('api_token', 64)->unique();
      // 注意这里需要mysql5.7以上 支持json格式
      $table->json('settings')->nullable();
      $table->rememberToken();
      $table->timestamps();
    });
  }
  1. 执行 php artisan migrate 生成user table