for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class AddForeignKeysToLabelsTable extends Migration
{
/**
* Run the migrations.
*/
public function up()
Schema::table('labels', function (Blueprint $table) {
$table->foreign('user_id', 'fk_labels_user_id')->references('id')->on('users')->onUpdate('NO ACTION')->onDelete('NO ACTION');
});
}
* Reverse the migrations.
public function down()
$table->dropForeign('fk_labels_user_id');