Skip to content

Commit

Permalink
Merge pull request #101 from Treblle/feature/about-info
Browse files Browse the repository at this point in the history
Feature/about info
  • Loading branch information
JustSteveKing authored Oct 11, 2024
2 parents eeef8e3 + 6320c47 commit a889649
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Middlewares/TreblleMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function terminate(Request $request, JsonResponse|Response|SymfonyRespons
}

Treblle::log(
endpoint: config('treblle.endpoint', Endpoint::random()),
endpoint: config('treblle.url', Endpoint::random()),
data: $this->factory->make(
request: $request,
response: $response,
Expand Down
14 changes: 14 additions & 0 deletions src/TreblleServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Illuminate\Contracts\Container\BindingResolutionException;
use Illuminate\Contracts\Support\DeferrableProvider;
use Illuminate\Events\Dispatcher;
use Illuminate\Foundation\Console\AboutCommand;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\ServiceProvider;
Expand All @@ -16,6 +17,8 @@
use Treblle\Commands\SetupCommand;
use Treblle\Contracts\TreblleClientContract;
use Treblle\Utils\Masking\FieldMasker;
use function config;
use function implode;

final class TreblleServiceProvider extends ServiceProvider implements DeferrableProvider
{
Expand Down Expand Up @@ -55,6 +58,17 @@ public function boot(): void
Cache::store('octane')->put($uuid, microtime(true));
});
}

AboutCommand::add(
section: 'Treblle',
data: static fn (): array => [
'Version' => Treblle::VERSION,
'URL' => config('treblle.url'),
'Project ID' => config('treblle.project_id'),
'API Key' => config('treblle.api_key'),
'Ignored Environments' => config('treblle.ignore_environments'),
],
);
}

/**
Expand Down

0 comments on commit a889649

Please sign in to comment.