relationships for local key and foreign key in UserRole relationship
This commit is contained in:
@@ -13,6 +13,6 @@ class UserRole extends Model
|
|||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
|
|
||||||
public function user() {
|
public function user() {
|
||||||
return $this->belongsTo('App\User');
|
return $this->belongsTo('App\User', 'character_id', 'user_id');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ class CreateUsersTable extends Migration
|
|||||||
Schema::create('users', function (Blueprint $table) {
|
Schema::create('users', function (Blueprint $table) {
|
||||||
$table->increments('id');
|
$table->increments('id');
|
||||||
$table->string('name');
|
$table->string('name');
|
||||||
$table->string('character_id');
|
$table->string('character_id')->unique();
|
||||||
$table->string('avatar');
|
$table->string('avatar');
|
||||||
$table->string('access_token')->nullable();
|
$table->string('access_token')->nullable();
|
||||||
$table->string('refresh_token')->nullable();
|
$table->string('refresh_token')->nullable();
|
||||||
@@ -25,7 +25,7 @@ class CreateUsersTable extends Migration
|
|||||||
$table->string('owner_hash');
|
$table->string('owner_hash');
|
||||||
$table->string('user_type')->default('Guest');
|
$table->string('user_type')->default('Guest');
|
||||||
$table->string('role')->default('Guest');
|
$table->string('role')->default('Guest');
|
||||||
$table->text('scopes')->default('publicData');
|
$table->text('scopes')->nullable();
|
||||||
$table->string('email')->unique()->nullable();
|
$table->string('email')->unique()->nullable();
|
||||||
$table->timestamp('email_verified_at')->nullable();
|
$table->timestamp('email_verified_at')->nullable();
|
||||||
$table->rememberToken();
|
$table->rememberToken();
|
||||||
|
|||||||
Reference in New Issue
Block a user