diff options
author | Sam Light <samlight1994@gmail.com> | 2025-04-09 22:45:43 +0100 |
---|---|---|
committer | Sam Light <samlight1994@gmail.com> | 2025-04-09 22:45:43 +0100 |
commit | 7ad7b1f0782f1c11e681f5664b62eb3ef8c2dd44 (patch) | |
tree | 0801b7015b949ec212cbfbc4624486c11c3f906a | |
parent | 254b5f1abfdec2a051988150d7c36df43f455cc1 (diff) |
Created migration for auth_log table
-rw-r--r-- | database/migrations/0000_00_00_000000_create_auth_log_table.php | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/database/migrations/0000_00_00_000000_create_auth_log_table.php b/database/migrations/0000_00_00_000000_create_auth_log_table.php new file mode 100644 index 0000000..64f905b --- /dev/null +++ b/database/migrations/0000_00_00_000000_create_auth_log_table.php @@ -0,0 +1,30 @@ +<?php + +use Illuminate\Database\Migrations\Migration; +use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; + +return new class extends Migration +{ + /** + * Run the migrations. + */ + public function up(): void + { + Schema::create(config('auth_log.table_name'), function (Blueprint $table) { + $table->id(); + $table->foreignId('user_id')->nullable(); + $table->enum('status', ['login_success', 'login_failure', 'logout']); + $table->jsonb('properties')->nullable(); + $table->timestamp('created_at'); + }); + } + + /**p + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists(config('auth_log.table_name')); + } +}; |