Skip to content

Commit

Permalink
refactor: extend HorizonServiceProvider from HorizonApplicationServic…
Browse files Browse the repository at this point in the history
…eProvider

- Updated HorizonServiceProvider to extend from HorizonApplicationServiceProvider for improved functionality.
- Added a call to the parent boot method to ensure proper initialization.
- Cleaned up the gate method by removing unnecessary whitespace.
  • Loading branch information
andrasbacsai committed Jan 10, 2025
1 parent 925af53 commit a0fc46d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/Providers/HorizonServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
use App\Repositories\CustomJobRepository;
use Illuminate\Support\Facades\Event;
use Illuminate\Support\Facades\Gate;
use Illuminate\Support\ServiceProvider;
use Laravel\Horizon\Contracts\JobRepository;
use Laravel\Horizon\Events\JobReserved;
use Laravel\Horizon\HorizonApplicationServiceProvider;

class HorizonServiceProvider extends ServiceProvider
class HorizonServiceProvider extends HorizonApplicationServiceProvider
{
/**
* Register services.
Expand All @@ -28,6 +28,7 @@ public function register(): void
*/
public function boot(): void
{
parent::boot();
Event::listen(function (JobReserved $event) {
$payload = $event->payload->decoded;
$jobName = $payload['displayName'];
Expand Down

0 comments on commit a0fc46d

Please sign in to comment.