apilogs
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (8.3) (push) Has been cancelled
tests / ci (8.4) (push) Has been cancelled
tests / ci (8.5) (push) Has been cancelled

This commit is contained in:
Ovidiu U
2026-04-04 08:41:21 +01:00
parent 9e0aebc729
commit 097f1b0529
11 changed files with 618 additions and 73 deletions

View File

@@ -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
{
public function up(): void
{
Schema::create('api_logs', function (Blueprint $table): void {
$table->id();
$table->string('service', 32)->comment('e.g. fuel_finder, fred, postcodes_io');
$table->string('method', 8)->comment('HTTP method: GET, POST');
$table->string('url', 512)->comment('Full URL including query string');
$table->unsignedSmallInteger('status_code')->nullable()->comment('HTTP status code; null if request threw an exception');
$table->unsignedInteger('duration_ms')->comment('Round-trip response time in milliseconds');
$table->text('error')->nullable()->comment('Exception message if request failed');
$table->dateTime('created_at');
$table->index('service');
$table->index('created_at');
});
}
public function down(): void
{
Schema::dropIfExists('api_logs');
}
};