Audit module: audit log and address bans
This commit is contained in:
1 parent
b75403e5ea
commit
d2ea1bacac
41 files changed
+2137
-5
No files matched your search
@@ -8,6 +8,7 @@ use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
use Illuminate\Validation\Rule;
|
||||
use IriksIT\Manager\Models\Post;
|
||||
use IriksIT\Manager\Support\AuditTrail;
|
||||
use IriksIT\Manager\Support\Markdown;
|
||||
|
||||
/**
|
||||
@@ -97,6 +98,7 @@ class PostController
|
||||
{
|
||||
$post = Post::query()->findOrFail($post);
|
||||
abort_unless($this->mayTouch($post), 403);
|
||||
app(AuditTrail::class)->about($post);
|
||||
|
||||
$post->update($this->validated($request, $post));
|
||||
|
||||
@@ -108,6 +110,7 @@ class PostController
|
||||
{
|
||||
$post = Post::query()->findOrFail($post);
|
||||
$request->validate(['online' => ['required', 'boolean']]);
|
||||
app(AuditTrail::class)->about($post);
|
||||
|
||||
$post->update(['published_at' => $request->boolean('online') ? ($post->published_at ?? now()) : null]);
|
||||
|
||||
@@ -118,6 +121,7 @@ class PostController
|
||||
{
|
||||
$post = Post::query()->findOrFail($post);
|
||||
abort_unless($this->mayTouch($post), 403);
|
||||
app(AuditTrail::class)->about($post);
|
||||
|
||||
$post->delete();
|
||||
|
||||
|
||||
Reference in new issue
Block a user