28 lines
785 B
PHP
Executable File
28 lines
785 B
PHP
Executable File
<?php
|
|
|
|
use Illuminate\Database\Capsule\Manager as Capsule;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
class CreateAuthAttemptsTable
|
|
{
|
|
public function up(): void
|
|
{
|
|
if (!Capsule::schema()->hasTable('auth_attempts')) {
|
|
Capsule::schema()->create('auth_attempts', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->string('email')->nullable();
|
|
$table->string('ip')->index();
|
|
$table->string('action')->index();
|
|
$table->boolean('success')->default(false);
|
|
$table->timestamp('created_at')->nullable();
|
|
});
|
|
}
|
|
}
|
|
|
|
public function down(): void
|
|
{
|
|
Capsule::schema()->dropIfExists('auth_attempts');
|
|
}
|
|
}
|
|
|