for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
use Arcanedev\LaravelAuth\Bases\Migration;
use Illuminate\Database\Schema\Blueprint;
/**
* Class CreatePermissionRoleTable
*
* @author ARCANEDEV <[email protected]>
*/
class CreateAuthThrottlesTable extends Migration
{
/* -----------------------------------------------------------------
| Constructor
| -----------------------------------------------------------------
* Make a migration instance.
public function __construct()
parent::__construct();
$this->setTable(config('laravel-auth.throttles.table', 'throttles'));
}
| Main Methods
* Run the migrations.
public function up()
if ($this->isThrottlable())
$this->createSchema(function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('user_id')->nullable();
$table->string('type');
$table->string('ip')->nullable();
$table->timestamps();
});
* Reverse the migrations.
public function down()
parent::down();
| Other Methods
* Check if throttles is enabled.
* @return bool
private function isThrottlable()
return config('laravel-auth.throttles.enabled', false);