25 lines
605 B
PHP
25 lines
605 B
PHP
<?php
|
|
|
|
use App\LogLevelEnum;
|
|
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('logs', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->enum('level', LogLevelEnum::toArray());
|
|
$table->string('message');
|
|
$table->json('context')->nullable();
|
|
$table->timestamps();
|
|
});
|
|
}
|
|
|
|
public function down(): void
|
|
{
|
|
Schema::dropIfExists('logs');
|
|
}
|
|
};
|