Skip to content

Streamline EventServiceProvider into RequestLoggerServiceProvider #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ No breaking changes. The only changes are to the development dependencies used f

## Changes

### 3.5.0 - 2025-02-11

- Move registration of event listeners to the main service provider and remove the dedicated EventServiceProvider.

### 3.4.0 - 2024-12-04

- Add PHP 8.4 support
Expand Down
26 changes: 0 additions & 26 deletions src/EventServiceProvider.php

This file was deleted.

6 changes: 4 additions & 2 deletions src/RequestLoggerServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
namespace Bilfeldt\RequestLogger;

use Bilfeldt\RequestLogger\Commands\PruneRequestLogsCommand;
use Bilfeldt\RequestLogger\Listeners\LogRequest;
use Bilfeldt\RequestLogger\Middleware\LogRequestMiddleware;
use Illuminate\Foundation\Http\Events\RequestHandled;
use Illuminate\Http\Request;
use Illuminate\Routing\Router;
use Illuminate\Support\Facades\Event;
use Illuminate\Support\ServiceProvider;

class RequestLoggerServiceProvider extends ServiceProvider
Expand All @@ -17,7 +20,7 @@ public function register()
{
$this->mergeConfigFrom(__DIR__.'/../config/request-logger.php', 'request-logger');

$this->app->register(EventServiceProvider::class);
Event::listen(RequestHandled::class, LogRequest::class);
}

/**
Expand All @@ -44,7 +47,6 @@ public function boot()
$this->bootMacros();

// TODO: Register command PruneRequestLogsCommand::class);
// TODO: Register EventServiceProvider::class
}

private function registerMiddlewareAlias(): void
Expand Down