create mapping entity
parent
3d06a539c8
commit
b9f786059e
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateHttpUsersTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('http_users', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
|
||||
$table->string('remote_id');
|
||||
$table->string('user_id');
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('http_users');
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\HttpHeaderAuth\Entities;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class HttpUser extends Model
|
||||
{
|
||||
protected $fillable = ['remote_id', 'user_id'];
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo('App\User');
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue