diff --git a/app/Modules/Sentry/Common.php b/app/Modules/Sentry/Common.php index 03f6f0a..a3c8d8d 100644 --- a/app/Modules/Sentry/Common.php +++ b/app/Modules/Sentry/Common.php @@ -3,6 +3,8 @@ namespace App\Modules\Sentry; +use Sentry\SentrySdk; + trait Common { public function setupSentryLogger() @@ -20,4 +22,13 @@ function sentryReport() report($e); } } + + /** @test */ + function sentryEvent() + { + $currentHub = SentrySdk::getCurrentHub(); + $client = $currentHub->getClient(); + + $eventId = $currentHub->captureMessage('This is a test message from the Sentry bundle'); + } } diff --git a/config/logging.php b/config/logging.php index 6af0a3c..67dfc95 100644 --- a/config/logging.php +++ b/config/logging.php @@ -68,7 +68,7 @@ 'handler' => \Monolog\Handler\SocketHandler::class, 'formatter' => \Monolog\Formatter\JsonFormatter::class, 'handler_with' => [ - 'connectionString' => env('LOG_SOCKET_URL', '127.0.0.1:9913'), + 'connectionString' => env('LOG_SOCKET_URL', '127.0.0.1:9912'), ], ], diff --git a/resources/views/welcome.blade.php b/resources/views/welcome.blade.php index 8167491..5c3da40 100644 --- a/resources/views/welcome.blade.php +++ b/resources/views/welcome.blade.php @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ - {{ config('app.name') }} + Buggregator - All-in-One PHP Debugging Solution | Lightweight & Powerful
@@ -23,8 +23,11 @@ - - + + @@ -33,21 +36,22 @@

- A server for debugging more than just Laravel applications. + Buggregator: Ultimate Debugging Server for PHP

- {{ config('app.name') }} is a beautiful, lightweight debug server build on Laravel that helps you debug your - app. + Buggregator is your one-stop lightweight debugging server tailor-made for PHP applications. Whether + you're a seasoned developer or taking your first steps, Buggregator equips you with advanced features + making issue identification and resolution a breeze.

- Use the command below to run {{ config('app.name') }} via docker container. + All you need to do is to run the following command in your terminal to start the server and it will + be ready to receive events from your application:

- docker run --pull always -p 23517:8000 -p 1025:1025 -p 9912:9912 -p 9913:9913 - butschster/buggregator:latest + docker run --pull always -p 8000:8000 -p 1025:1025 -p 9912:9912 -p 9913:9913 ghcr.io/buggregator/server:latest
@@ -58,69 +62,97 @@ class="mb-2 w-full bg-white text-gray-400 font-semibold hover:text-gray-700 font

demo

- +
@endif -
+
@if(config('app.buggregator_url')) -
- - - -
+
+ + + +
@endif
@foreach($buttonGroups as $group => $data) -
-

- {{ $data['title'] ?? \Illuminate\Support\Str::studly($group) }} -

+
+

+ {{ $data['title'] ?? \Illuminate\Support\Str::studly($group) }} +

+ + @if(isset($data['description'])) +

+ {{ $data['description'] }}

+ @endif - @if(isset($data['description'])) -

{{ $data['description'] }}

+
+

Click a button to send an event to Buggregator + server.

+ @foreach($data['events'] as $type => $buttons) + @if($type !== 'common') +

+ {{ \Illuminate\Support\Str::studly($type) }} +

@endif -
-

Click a button to send an event to Buggregator server.

- @foreach($data['events'] as $type => $buttons) - @if($type !== 'common') -

- {{ \Illuminate\Support\Str::studly($type) }} -

- @endif - -
- @foreach($buttons as $button) - - {{ $button }} - - @endforeach -
+
+ @foreach($buttons as $button) + + {{ $button }} + @endforeach
+ @endforeach
+
@endforeach
@@ -130,71 +162,84 @@ class="mb-2 w-full bg-white text-gray-400 font-semibold hover:text-gray-700 font
@verbatim - +
+
+ +
+
+
+ ` + }) + + Vue.component('button-action', { + props: { + action: String + }, + methods: { + callAction() { + const url = this.action === 'profiler:report' ? '/_profiler' : '/'; + fetch(url, { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify({action: this.action}) + }) + .then(data => console.log(data)); + } + }, + template: ` + + ` + }) + + new Vue({ + el: '#app', + }) + @endverbatim @if(config('app.google_tagmanager')) @@ -202,10 +247,18 @@ class="mb-2 w-full bg-white text-gray-400 font-semibold hover:text-gray-700 font @endif diff --git a/routes/web.php b/routes/web.php index c228a6f..e8f2745 100644 --- a/routes/web.php +++ b/routes/web.php @@ -4,29 +4,29 @@ Route::get('/', function () { $buttonGroups = [ -// 'ray' => [ -// 'title' => 'Buggregator is compatible with spatie/ray package.', -// 'description' => 'The Ray debug tool supports PHP, Ruby, JavaScript, TypeScript, NodeJS, Go and Bash applications. After installing one of the libraries, you can use the ray function to quickly dump stuff. Any variable(s) that you pass will be sent to the Buggregator.', -// 'events' => [ -// 'common' => [ -// 'NewScreen', 'NewScreenWithName', 'ClearAll', 'ClearScreen', 'Int', 'String', -// 'Array', 'Bool', 'Object', 'Colors', 'Sizes', 'Labels', 'Caller', 'Trace', 'Pause', -// 'Counter', 'CounterWithName', 'Limit', 'ClassName', 'Measure', 'Json', 'Xml', 'Carbon', -// 'File', 'Table', 'Image', 'Html', 'Text', 'Hide', 'Notify', 'Phpinfo', 'Exception', 'Markdown' -// ], -// 'laravel' => [ -// 'ShowQueries', 'CountQueries', 'ManuallyShowedQuery', 'ShowEvents', 'ShowJobs', 'ShowCache', -// 'ShowHttpClientRequests', 'HandlingModels', 'Mailable', 'ShowViews', 'Collections', 'StrString', -// 'Env', -// ], -// 'logs' => [ -// 'Debug', 'Info', 'Warning', 'Error', 'Critical', 'Notice', 'Alert', 'Emergency', 'Exception' -// ] -// ] -// ], + 'ray' => [ + 'title' => 'Buggregator is compatible with spatie/ray package.', + 'description' => 'The Ray debug tool supports PHP, Ruby, JavaScript, TypeScript, NodeJS, Go and Bash applications. After installing one of the libraries, you can use the ray function to quickly dump stuff. Any variable(s) that you pass will be sent to the Buggregator.', + 'events' => [ + 'common' => [ + 'NewScreen', 'NewScreenWithName', 'ClearAll', 'ClearScreen', 'Int', 'String', + 'Array', 'Bool', 'Object', 'Colors', 'Sizes', 'Labels', 'Caller', 'Trace', 'Pause', + 'Counter', 'CounterWithName', 'Limit', 'ClassName', 'Measure', 'Json', 'Xml', 'Carbon', + 'File', 'Table', 'Image', 'Html', 'Text', 'Hide', 'Notify', 'Phpinfo', 'Exception', 'Markdown' + ], + 'laravel' => [ + 'ShowQueries', 'CountQueries', 'ManuallyShowedQuery', 'ShowEvents', 'ShowJobs', 'ShowCache', + 'ShowHttpClientRequests', 'HandlingModels', 'Mailable', 'ShowViews', 'Collections', 'StrString', + 'Env', + ], + 'logs' => [ + 'Debug', 'Info', 'Warning', 'Error', 'Critical', 'Notice', 'Alert', 'Emergency', 'Exception' + ] + ] + ], 'profiler' => [ 'title' => 'Buggregator can be used to profile application with xhprof.', - 'description' => '', + 'description' => 'Efficiently fine-tune your PHP application\'s performance by identifying performance bottlenecks.', 'events' => [ 'common' => [ 'Report', @@ -35,16 +35,16 @@ ], 'sentry' => [ 'title' => 'Buggregator can bs used to receive Sentry reports from your application.', - 'description' => 'Buggregator is a lightweight alternative for local development. Just configure Sentry DSN to send data to Buggregator.', + 'description' => 'Directly send data to the server and debug your app with this lightweight alternative.', 'events' => [ 'common' => [ - 'Report', + 'Report', 'Event' ], ], ], 'monolog' => [ 'title' => 'Buggregator can receive logs from monolog/monolog package.', - 'description' => 'It can receive logs via \Monolog\Handler\SocketHandler handler.', + 'description' => 'Analyze logs from your PHP application for improved insights and performance.', 'events' => [ 'common' => [ 'Debug', @@ -61,7 +61,7 @@ ], 'smtp' => [ 'title' => 'Buggregator also is an email testing tool that makes it super easy to install and configure a local email server (Like MailHog).', - 'description' => 'Buggregator sets up a fake SMTP server and you can configure your preferred web applications to use Buggregator’s SMTP server to send and receive emails. For instance, you can configure a local WordPress site to use Buggregator for email deliveries.', + 'description' => 'Test email functionality with ease during the development phase using Buggregator\'s SMTP server.', 'events' => [ 'common' => [ 'OrderShipped', @@ -71,7 +71,7 @@ ], 'var_dump' => [ 'title' => 'Buggregator can receive dumps from symfony/var-dumper package.', - 'description' => 'The dump() and dd() functions output its contents in the same browser window or console terminal as your own application. Sometimes mixing the real output with the debug output can be confusing. That’s why this Buggregator can be used to collect all the dumped data.', + 'description' => 'A distinct space for debugging outputs, making data dump collection simpler. The dump() and dd() functions output its contents in the same browser window or console terminal as your own application. Sometimes mixing the real output with the debug output can be confusing. That’s why this Buggregator can be used to collect all the dumped data.', 'events' => [ 'common' => [ 'String', @@ -85,6 +85,7 @@ ], 'inspector' => [ 'title' => 'Buggregator can be used to receive Inspector reports from your application.', + 'description' => 'A handy feature for local development, ensuring swift issue identification and resolution.', 'events' => [ 'common' => [ 'Request',