Skip to content

Commit

Permalink
Failed jobs viewer (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexjustesen authored Oct 28, 2022
1 parent 320fbb1 commit 00f3be1
Show file tree
Hide file tree
Showing 4 changed files with 149 additions and 2 deletions.
16 changes: 16 additions & 0 deletions app/Policies/FailedJobPolicy.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

namespace App\Policies;

use App\Models\User;
use Illuminate\Auth\Access\HandlesAuthorization;

class FailedJobPolicy
{
use HandlesAuthorization;

public function viewAny(User $user): bool
{
return env('APP_DEBUG');
}
}
5 changes: 4 additions & 1 deletion app/Providers/AuthServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
namespace App\Providers;

// use Illuminate\Support\Facades\Gate;

use Amvisor\FilamentFailedJobs\Models\FailedJob;
use App\Policies\FailedJobPolicy;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;

class AuthServiceProvider extends ServiceProvider
Expand All @@ -13,7 +16,7 @@ class AuthServiceProvider extends ServiceProvider
* @var array<class-string, class-string>
*/
protected $policies = [
// 'App\Models\Model' => 'App\Policies\ModelPolicy',
FailedJob::class => FailedJobPolicy::class,
];

/**
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"license": "MIT",
"require": {
"php": "^8.0.2",
"amvisor/filament-failed-jobs": "^0.6.0",
"doctrine/dbal": "^3.4",
"dragonmantank/cron-expression": "^3.3",
"filament/filament": "^2.0",
Expand Down
129 changes: 128 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 00f3be1

Please sign in to comment.