first commit

This commit is contained in:
brusnitsyn
2026-06-24 17:20:43 +09:00
commit 43499acf1c
165 changed files with 25929 additions and 0 deletions

50
app/Models/AuditLog.php Normal file
View File

@@ -0,0 +1,50 @@
<?php
namespace App\Models;
use Carbon\CarbonImmutable;
use Illuminate\Database\Eloquent\Model;
/**
* Запись журнала регистрации событий безопасности.
*
* Мера ФСТЭК: РСБ.2, РСБ.3. Хранится в отдельном соединении (audit) с правами
* только на INSERT/SELECT. Изменение/удаление записей пользователями запрещено.
*
* @property string $event_id
* @property string $event_type
* @property string|null $user_id
* @property string|null $ip
* @property string|null $user_agent
* @property string|null $session_id
* @property string|null $resource
* @property string $action
* @property string $result
* @property array<string, mixed>|null $details
* @property string|null $prev_hash
* @property string $signature
* @property int $id
* @property CarbonImmutable|null $created_at
*/
class AuditLog extends Model
{
// Журнал неизменяемый: updated_at не нужен.
public const UPDATED_AT = null;
protected $guarded = [];
protected $casts = [
'details' => 'array',
'created_at' => 'datetime',
];
public function getConnectionName(): ?string
{
return config('audit.connection', 'audit');
}
public function getTable(): string
{
return config('audit.table', 'audit_log');
}
}