allowed login models and update of login controller

This commit is contained in:
2019-01-09 00:20:57 -06:00
parent d57e979dd3
commit c4ab315d76
8 changed files with 114 additions and 51 deletions

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class DropUsersRoleColumn extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
if(Schema::hasColumn('users', 'role')) {
Schema::table('users', function($table) {
$table->dropColumn('role');
});
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}

View File

@@ -0,0 +1,35 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateAllowedLoginsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
if(!Schema::hasTable('allowed_logins')) {
Schema::create('allowed_logins', function (Blueprint $table) {
$table->increments('id');
$table->string('entity_id');
$table->string('entity_type');
$table->timestamps();
});
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('allowed_logins');
}
}