Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save wichaksono/b7532e4e83f6bd3f11f71469c23a6df3 to your computer and use it in GitHub Desktop.
Save wichaksono/b7532e4e83f6bd3f11f71469c23a6df3 to your computer and use it in GitHub Desktop.
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateUserRolesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('role_user', function (Blueprint $table) {
$table->unsignedInteger('user_id');
$table->unsignedInteger('role_id');
$table->primary(['user_id', 'role_id']);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('role_user');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment