Skip to content

Commit 00f3be1

Browse files
authored
Failed jobs viewer (alexjustesen#94)
1 parent 320fbb1 commit 00f3be1

File tree

4 files changed

+149
-2
lines changed

4 files changed

+149
-2
lines changed

app/Policies/FailedJobPolicy.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
namespace App\Policies;
4+
5+
use App\Models\User;
6+
use Illuminate\Auth\Access\HandlesAuthorization;
7+
8+
class FailedJobPolicy
9+
{
10+
use HandlesAuthorization;
11+
12+
public function viewAny(User $user): bool
13+
{
14+
return env('APP_DEBUG');
15+
}
16+
}

app/Providers/AuthServiceProvider.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
namespace App\Providers;
44

55
// use Illuminate\Support\Facades\Gate;
6+
7+
use Amvisor\FilamentFailedJobs\Models\FailedJob;
8+
use App\Policies\FailedJobPolicy;
69
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
710

811
class AuthServiceProvider extends ServiceProvider
@@ -13,7 +16,7 @@ class AuthServiceProvider extends ServiceProvider
1316
* @var array<class-string, class-string>
1417
*/
1518
protected $policies = [
16-
// 'App\Models\Model' => 'App\Policies\ModelPolicy',
19+
FailedJob::class => FailedJobPolicy::class,
1720
];
1821

1922
/**

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"license": "MIT",
77
"require": {
88
"php": "^8.0.2",
9+
"amvisor/filament-failed-jobs": "^0.6.0",
910
"doctrine/dbal": "^3.4",
1011
"dragonmantank/cron-expression": "^3.3",
1112
"filament/filament": "^2.0",

composer.lock

Lines changed: 128 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)