Create audit log table and model

This commit is contained in:
Matt Young 2024-08-05 15:59:04 -05:00
parent 9daa34dd26
commit b4310ca04b
2 changed files with 41 additions and 0 deletions

View File

@ -0,0 +1,11 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class AuditLogEntry extends Model
{
use HasFactory;
}

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
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('audit_log_entries', function (Blueprint $table) {
$table->id();
$table->string('user');
$table->string('message');
$table->json('affected')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('audit_log_entries');
}
};