:::

4-2 database\migrations\2019_06_21_144827_change_users_table.php

<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class ChangeUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('users', function (Blueprint $table) {
            // 在 password 欄位後面新增 address 欄位
            $table->string('address')->after('password');
            // 在 address 欄位後面新增 tel 欄位
            $table->string('tel')->after('address');
        });

    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('users', function (Blueprint $table) {
            $table->dropColumn('tel');
            $table->dropColumn('address');
        });

    }
}

 


:::

書籍目錄

展開 | 闔起

http%3A%2F%2Fcampus-xoops.tn.edu.tw%2Fmodules%2Ftad_book3%2Fpage.php%3Ftbsn%3D44%26tbdsn%3D1468

計數器

今天: 2665266526652665
昨天: 3176317631763176
總計: 7452097745209774520977452097745209774520977452097