Skip to content

Commit 7fcbc96

Browse files
committed
Simplify Laravel Metrics onboarding
1 parent eb5ecf7 commit 7fcbc96

File tree

1 file changed

+2
-26
lines changed

1 file changed

+2
-26
lines changed

static/app/gettingStartedDocs/php/laravel.tsx

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -61,31 +61,7 @@ use function \\Sentry\\metrics;
6161
6262
// Add 4 to a counter named 'hits'
6363
metrics()->increment('hits', 4);
64-
metrics()->flush();
65-
66-
// We recommend registering the flush call in a shutdown function
67-
register_shutdown_function(static fn () => metrics()->flush());
68-
69-
// Or call flush in a Terminable Middleware
70-
71-
use Closure;
72-
use Illuminate\\Http\\Request;
73-
use Symfony\\Component\\HttpFoundation\\Response;
74-
75-
use function \\Sentry\\metrics;
76-
77-
class SentryMetricsMiddleware
78-
{
79-
public function handle(Request $request, Closure $next): Response
80-
{
81-
return $next($request);
82-
}
83-
84-
public function terminate(Request $request, Response $response): void
85-
{
86-
metrics()->flush();
87-
}
88-
}`;
64+
`;
8965

9066
const onboarding: OnboardingConfig = {
9167
introduction: () =>
@@ -188,7 +164,7 @@ const customMetricsOnboarding: OnboardingConfig = {
188164
{
189165
type: StepType.INSTALL,
190166
description: tct(
191-
'You need a minimum version [codeVersionLaravel:4.0.0] of the Laravel SDK and a minimum version [codeVersion:4.3.0] of the PHP SDK installed',
167+
'You need a minimum version [codeVersionLaravel:4.2.0] of the Laravel SDK and a minimum version [codeVersion:4.3.0] of the PHP SDK installed',
192168
{
193169
codeVersionLaravel: <code />,
194170
codeVersion: <code />,

0 commit comments

Comments
 (0)