mirror of
https://github.com/usetrmnl/byos_laravel.git
synced 2026-01-13 15:07:49 +00:00
feat: inspect device logs
feat: create DeviceLog model on log request feat: implement logs route, logs view feat: implement details on device log timezone, latest 50 log items sort by latest device timestamp cleanup job add tests
This commit is contained in:
parent
04d089c445
commit
c045dc1e85
12 changed files with 425 additions and 0 deletions
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
use App\Models\Device;
|
||||
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('device_logs', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignIdFor(Device::class)->constrained('devices')->cascadeOnDelete();
|
||||
$table->timestamp('device_timestamp');
|
||||
$table->json('log_entry');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('device_logs');
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue