for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of questocat/laravel-referral package.
*
* (c) questocat <[email protected]>
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddReferralToUsersTable extends Migration
{
/**
* Run the migrations.
public function up()
Schema::table('users', function (Blueprint $table) {
$table->string('referred_by')->nullable()->index();
$table->string('affiliate_id')->unique();
});
}
* Reverse the migrations.
public function down()
$table->dropColumn('referred_by');
$table->dropColumn('affiliate_id');