From 70a35f5a79b2f84b97502f18eb9de5eece15b7fb Mon Sep 17 00:00:00 2001 From: Bezhan Salleh Date: Tue, 1 Aug 2023 17:58:51 +0430 Subject: [PATCH 01/28] UPDATED README --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index cbf9ead..3cd033b 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,18 @@ - + filament-exceptions-art -

+

- FILAMENT 8.x + FILAMENT 8.x Packagist - + Tests Passing - + Code Style Passing @@ -21,7 +21,7 @@

-# Filament Exception Viewer +# Exception Viewer A Simple & Beautiful Exception Viewer for FilamentPHP's Admin Panel From 219d9c5585c81acd8b1286c13049160bd084998c Mon Sep 17 00:00:00 2001 From: Dylan Marriott <11637247+Fludem@users.noreply.github.com> Date: Mon, 22 Jan 2024 06:42:26 +0000 Subject: [PATCH 02/28] Remove unused import Add as ExceptionModel to be clear what we're refering to --- src/FilamentExceptions.php | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/src/FilamentExceptions.php b/src/FilamentExceptions.php index bc6fb24..308aaad 100755 --- a/src/FilamentExceptions.php +++ b/src/FilamentExceptions.php @@ -2,11 +2,11 @@ namespace BezhanSalleh\FilamentExceptions; -use BezhanSalleh\FilamentExceptions\Models\Exception; + +use BezhanSalleh\FilamentExceptions\Models\Exception as ExceptionModel; use Illuminate\Foundation\Application; use Illuminate\Http\Request; use Illuminate\Support\Arr; -use Illuminate\Support\Facades\DB; use Spatie\LaravelIgnition\Recorders\QueryRecorder\QueryRecorder; use Throwable; @@ -37,6 +37,13 @@ public static function report(Throwable $exception) $reporter->reportException($exception); } + /** @return ExceptionModel */ + public static function model() + { + $class = config('filament-exceptions.exception_model'); + return $class; + } + /** * @return void */ @@ -63,7 +70,8 @@ public function reportException(Throwable $exception) try { $this->store($data); - } catch (Throwable $e) { + } + catch (Throwable $e) { throw $e; } } @@ -71,7 +79,7 @@ public function reportException(Throwable $exception) /** * Convert all items to string. */ - public function stringify($data): array + public function stringify($data) : array { return array_map(function ($item) { return is_array($item) ? json_encode($item, JSON_OBJECT_AS_ARRAY) : (string) $item; @@ -81,18 +89,19 @@ public function stringify($data): array /** * Store exception info to db. */ - public function store(array $data): bool + public function store(array $data) : bool { try { - Exception::query()->create($data); + $this->model()::query()->create($data); return true; - } catch (Throwable $e) { + } + catch (Throwable $e) { return false; } } - public static function formatFileName(string $fileName): string + public static function formatFileName(string $fileName) : string { return str($fileName) ->after(str(request()->getHost())->beforeLast('.')->toString()) From 75f9939f00909cb953b71c2072a403e0123b67fe Mon Sep 17 00:00:00 2001 From: Dylan Marriott <11637247+Fludem@users.noreply.github.com> Date: Mon, 22 Jan 2024 06:43:13 +0000 Subject: [PATCH 03/28] Remove unused function formtFileName from FilamentExcepitons --- src/FilamentExceptions.php | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/FilamentExceptions.php b/src/FilamentExceptions.php index 308aaad..c864c13 100755 --- a/src/FilamentExceptions.php +++ b/src/FilamentExceptions.php @@ -101,12 +101,4 @@ public function store(array $data) : bool } } - public static function formatFileName(string $fileName) : string - { - return str($fileName) - ->after(str(request()->getHost())->beforeLast('.')->toString()) - ->afterLast('/') - ->prepend('.../') - ->toString(); - } } From fd52566e3b14f0df4d929b252b80574d399227d8 Mon Sep 17 00:00:00 2001 From: Dylan Marriott <11637247+Fludem@users.noreply.github.com> Date: Mon, 22 Jan 2024 13:28:41 +0000 Subject: [PATCH 04/28] Add Exception model key/value to config file --- config/filament-exceptions.php | 40 +++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/config/filament-exceptions.php b/config/filament-exceptions.php index 35bb664..ce8a7d1 100644 --- a/config/filament-exceptions.php +++ b/config/filament-exceptions.php @@ -1,5 +1,7 @@ 'exceptions', @@ -13,6 +15,8 @@ /** Whether to show a navigation badge. No effect, if navigation_enabled it set to false. */ 'navigation_badge' => true, + 'exception_model' => Exception::class, + /** Icons to use for navigation (if enabled) and pills */ 'icons' => [ 'navigation' => 'heroicon-o-cpu-chip', @@ -26,27 +30,27 @@ 'is_globally_searchable' => false, /**------------------------------------------------- - * Change the default active tab - * - * Exception => 1 (Default) - * Headers => 2 - * Cookies => 3 - * Body => 4 - * Queries => 5 - */ + * Change the default active tab + * + * Exception => 1 (Default) + * Headers => 2 + * Cookies => 3 + * Body => 4 + * Queries => 5 + */ 'active_tab' => 5, /**------------------------------------------------- - * Here you can define when the exceptions should be pruned - * The default is 7 days (a week) - * The format for providing period should follow carbon's format. i.e. - * 1 day => 'subDay()', - * 3 days => 'subDays(3)', - * 7 days => 'subWeek()', - * 1 month => 'subMonth()', - * 2 months => 'subMonths(2)', - * - */ + * Here you can define when the exceptions should be pruned + * The default is 7 days (a week) + * The format for providing period should follow carbon's format. i.e. + * 1 day => 'subDay()', + * 3 days => 'subDays(3)', + * 7 days => 'subWeek()', + * 1 month => 'subMonth()', + * 2 months => 'subMonths(2)', + * + */ 'period' => now()->subWeek(), ]; From daa5f2e61c47e99fbbe5891d66240c23d9d52d48 Mon Sep 17 00:00:00 2001 From: Dylan Marriott <11637247+Fludem@users.noreply.github.com> Date: Mon, 22 Jan 2024 13:29:15 +0000 Subject: [PATCH 05/28] Remove $model variable and use getModel() to return model class --- src/Resources/ExceptionResource.php | 86 +++++++++++++++-------------- 1 file changed, 45 insertions(+), 41 deletions(-) diff --git a/src/Resources/ExceptionResource.php b/src/Resources/ExceptionResource.php index d090b9e..9df8ab6 100644 --- a/src/Resources/ExceptionResource.php +++ b/src/Resources/ExceptionResource.php @@ -2,7 +2,7 @@ namespace BezhanSalleh\FilamentExceptions\Resources; -use BezhanSalleh\FilamentExceptions\Models\Exception; +use BezhanSalleh\FilamentExceptions\Facades\FilamentExceptions; use BezhanSalleh\FilamentExceptions\Resources\ExceptionResource\Pages; use Filament\Forms; use Filament\Forms\Form; @@ -12,99 +12,103 @@ class ExceptionResource extends Resource { - protected static ?string $model = Exception::class; - public static function getModelLabel(): string + public static function getModel() : string + { + return FilamentExceptions::model(); + } + + public static function getModelLabel() : string { return __('filament-exceptions::filament-exceptions.labels.model'); } - public static function getPluralModelLabel(): string + public static function getPluralModelLabel() : string { return __('filament-exceptions::filament-exceptions.labels.model_plural'); } - public static function getNavigationGroup(): ?string + public static function getNavigationGroup() : ?string { return __('filament-exceptions::filament-exceptions.labels.navigation_group'); } - public static function getNavigationLabel(): string + public static function getNavigationLabel() : string { return __('filament-exceptions::filament-exceptions.labels.navigation'); } - public static function getNavigationIcon(): string + public static function getNavigationIcon() : string { return config('filament-exceptions.icons.navigation'); } - public static function getSlug(): string + public static function getSlug() : string { return config('filament-exceptions.slug'); } - public static function getNavigationBadge(): ?string + public static function getNavigationBadge() : ?string { if (config('filament-exceptions.navigation_badge')) { - return static::$model::count(); + return static::getModel()::count(); } return null; } - public static function shouldRegisterNavigation(): bool + public static function shouldRegisterNavigation() : bool { return (bool) config('filament-exceptions.navigation_enabled'); } - public static function getNavigationSort(): ?int + public static function getNavigationSort() : ?int { return config('filament-exceptions.navigation_sort'); } - public static function canGloballySearch(): bool + public static function canGloballySearch() : bool { return config('filament-exceptions.is_globally_searchable') && count(static::getGloballySearchableAttributes()) && static::canViewAny(); } - public static function form(Form $form): Form + public static function form(Form $form) : Form { return $form ->schema([ Forms\Components\Tabs::make('Heading') - ->activeTab(static fn (): int => config('filament-exceptions.active_tab')) + ->activeTab(static fn () : int => config('filament-exceptions.active_tab')) ->tabs([ Forms\Components\Tabs\Tab::make('Exception') - ->label(static fn (): string => __('filament-exceptions::filament-exceptions.labels.tabs.exception')) - ->icon(static fn (): string => config('filament-exceptions.icons.exception')) + ->label(static fn () : string => __('filament-exceptions::filament-exceptions.labels.tabs.exception')) + ->icon(static fn () : string => config('filament-exceptions.icons.exception')) ->schema([ Forms\Components\View::make('filament-exceptions::exception'), ]), Forms\Components\Tabs\Tab::make('Headers') - ->label(static fn (): string => __('filament-exceptions::filament-exceptions.labels.tabs.headers')) - ->icon(static fn (): string => config('filament-exceptions.icons.headers')) + ->label(static fn () : string => __('filament-exceptions::filament-exceptions.labels.tabs.headers')) + ->icon(static fn () : string => config('filament-exceptions.icons.headers')) ->schema([ Forms\Components\View::make('filament-exceptions::headers'), ])->columns(1), Forms\Components\Tabs\Tab::make('Cookies') - ->label(static fn (): string => __('filament-exceptions::filament-exceptions.labels.tabs.cookies')) - ->icon(static fn (): string => config('filament-exceptions.icons.cookies')) + ->label(static fn () : string => __('filament-exceptions::filament-exceptions.labels.tabs.cookies')) + ->icon(static fn () : string => config('filament-exceptions.icons.cookies')) ->schema([ Forms\Components\View::make('filament-exceptions::cookies'), ]), Forms\Components\Tabs\Tab::make('Body') - ->label(static fn (): string => __('filament-exceptions::filament-exceptions.labels.tabs.body')) - ->icon(static fn (): string => config('filament-exceptions.icons.body')) + ->label(static fn () : string => __('filament-exceptions::filament-exceptions.labels.tabs.body')) + ->icon(static fn () : string => config('filament-exceptions.icons.body')) ->schema([ Forms\Components\View::make('filament-exceptions::body'), ]), Forms\Components\Tabs\Tab::make('Queries') - ->label(static fn (): string => __('filament-exceptions::filament-exceptions.labels.tabs.queries')) - ->icon(static fn (): string => config('filament-exceptions.icons.queries')) - ->badge(static fn ($record): string => collect(json_decode($record->query, true, 512, JSON_THROW_ON_ERROR))->count()) + ->label(static fn () : string => __('filament-exceptions::filament-exceptions.labels.tabs.queries')) + ->icon(static fn () : string => config('filament-exceptions.icons.queries')) + ->badge(static fn ($record) : string => collect(json_decode($record->query, true, 512, JSON_THROW_ON_ERROR))->count()) ->schema([ Forms\Components\View::make('filament-exceptions::query'), ]), @@ -113,46 +117,46 @@ public static function form(Form $form): Form ])->columns(1); } - public static function table(Table $table): Table + public static function table(Table $table) : Table { return $table ->columns([ Tables\Columns\TextColumn::make('method') - ->label(fn (): string => __('filament-exceptions::filament-exceptions.columns.method')) + ->label(fn () : string => __('filament-exceptions::filament-exceptions.columns.method')) ->badge() ->colors([ 'gray', - 'success' => fn ($state): bool => $state === 'GET', - 'primary' => fn ($state): bool => $state === 'POST', - 'warning' => fn ($state): bool => $state === 'PUT', - 'danger' => fn ($state): bool => $state === 'DELETE', - 'warning' => fn ($state): bool => $state === 'PATCH', - 'gray' => fn ($state): bool => $state === 'OPTIONS', + 'success' => fn ($state) : bool => $state === 'GET', + 'primary' => fn ($state) : bool => $state === 'POST', + 'warning' => fn ($state) : bool => $state === 'PUT', + 'danger' => fn ($state) : bool => $state === 'DELETE', + 'warning' => fn ($state) : bool => $state === 'PATCH', + 'gray' => fn ($state) : bool => $state === 'OPTIONS', ]) ->searchable() ->sortable(), Tables\Columns\TextColumn::make('path') - ->label(fn (): string => __('filament-exceptions::filament-exceptions.columns.path')) + ->label(fn () : string => __('filament-exceptions::filament-exceptions.columns.path')) ->searchable(), Tables\Columns\TextColumn::make('type') - ->label(fn (): string => __('filament-exceptions::filament-exceptions.columns.type')) + ->label(fn () : string => __('filament-exceptions::filament-exceptions.columns.type')) ->sortable() ->searchable(), Tables\Columns\TextColumn::make('code') - ->label(fn (): string => __('filament-exceptions::filament-exceptions.columns.code')) + ->label(fn () : string => __('filament-exceptions::filament-exceptions.columns.code')) ->searchable() ->sortable() ->toggleable(isToggledHiddenByDefault: false), Tables\Columns\TextColumn::make('ip') - ->label(fn (): string => __('filament-exceptions::filament-exceptions.columns.ip')) + ->label(fn () : string => __('filament-exceptions::filament-exceptions.columns.ip')) ->badge() ->extraAttributes(['class' => 'font-mono']) ->sortable() ->searchable() ->toggleable(isToggledHiddenByDefault: false), Tables\Columns\TextColumn::make('created_at') - ->label(fn (): string => __('filament-exceptions::filament-exceptions.columns.occurred_at')) + ->label(fn () : string => __('filament-exceptions::filament-exceptions.columns.occurred_at')) ->sortable() ->searchable() ->dateTime() @@ -173,14 +177,14 @@ public static function table(Table $table): Table ->defaultSort('created_at', 'desc'); } - public static function getRelations(): array + public static function getRelations() : array { return [ // ]; } - public static function getPages(): array + public static function getPages() : array { return [ 'index' => Pages\ListExceptions::route('/'), From 2db49ac43549ce0a6b0f22a4363dcc9cff8a4bd3 Mon Sep 17 00:00:00 2001 From: Dylan Marriott <11637247+Fludem@users.noreply.github.com> Date: Mon, 22 Jan 2024 13:47:14 +0000 Subject: [PATCH 06/28] Change position of exception in config file --- config/filament-exceptions.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/filament-exceptions.php b/config/filament-exceptions.php index ce8a7d1..13e221b 100644 --- a/config/filament-exceptions.php +++ b/config/filament-exceptions.php @@ -4,6 +4,8 @@ return [ + 'exception_model' => Exception::class, + 'slug' => 'exceptions', /** Show or hide in navigation/sidebar */ @@ -15,8 +17,6 @@ /** Whether to show a navigation badge. No effect, if navigation_enabled it set to false. */ 'navigation_badge' => true, - 'exception_model' => Exception::class, - /** Icons to use for navigation (if enabled) and pills */ 'icons' => [ 'navigation' => 'heroicon-o-cpu-chip', @@ -52,5 +52,5 @@ * */ - 'period' => now()->subWeek(), + 'period' => now()->subDays(5), ]; From 5f1d9290f50f1b61f12357fcbfa7dcb0dc8a42ea Mon Sep 17 00:00:00 2001 From: Dylan Marriott <11637247+Fludem@users.noreply.github.com> Date: Mon, 22 Jan 2024 13:56:38 +0000 Subject: [PATCH 07/28] Update readme --- README.md | 39 +++++++++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index d1d051a..43a16c7 100644 --- a/README.md +++ b/README.md @@ -78,11 +78,42 @@ class Handler extends ExceptionHandler ## Configuration The configuration file filament-exceptions.php is automatically published into your config directory. -You can change icons and navigations settings as well as the active pill and slug there. -* **Mass Pruning**: By default exceptions older than a week are scheduled to be pruned daily. You can change the `period` by providing a date in the config or using carbon. -> **Note** -> in order for the schedule to work you need to make sure that you have configured your server if not follow this link on how to configure it. [Running The Scheduler](https://laravel.com/docs/9.x/scheduling#running-the-scheduler) +The config file provides you with multiple options to customize the plugin. + +### Mass Pruning +By default Filament Exceptions is configured to prune exceptions older than 1 week. + +To modify how long you'd like to store records for you can supply a Carbon object like so + +```php +'period' => now()->subWeek(), // 1 week +'period' => now()->subDay(), // 1 day +'period' => now()->subDays(3), // 3 days +``` +> **Note** This requires laravel scheduler to be setup and configured in order to work. You can see how to do that here [Running The Scheduler](https://laravel.com/docs/10.x/scheduling#running-the-scheduler) + +### Custom Exception Model +For those who need to change the model this is possible using the configuration file. + +```php + 'exception_model' => Exception::class, +``` + +When creating your new exception model you should extend the default model + +```php + Date: Mon, 22 Jan 2024 13:57:39 +0000 Subject: [PATCH 08/28] Update return type of model function Handle case where config option isn't supplied for backwards compatability --- src/FilamentExceptions.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/FilamentExceptions.php b/src/FilamentExceptions.php index c864c13..b13d842 100755 --- a/src/FilamentExceptions.php +++ b/src/FilamentExceptions.php @@ -37,11 +37,12 @@ public static function report(Throwable $exception) $reporter->reportException($exception); } - /** @return ExceptionModel */ - public static function model() + public static function model() : string { - $class = config('filament-exceptions.exception_model'); - return $class; + if (config('filament-exceptions.exception_model') === null) { + return ExceptionModel::class; + } + return config('filament-exceptions.exception_model'); } /** From 1a5bc73cc39276e1498ec91ef42726d7f55d7dc1 Mon Sep 17 00:00:00 2001 From: Dylan Marriott <11637247+Fludem@users.noreply.github.com> Date: Mon, 22 Jan 2024 14:11:48 +0000 Subject: [PATCH 09/28] Add return type will change attribute to supress error --- src/Trace/Parser.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Trace/Parser.php b/src/Trace/Parser.php index 00ff812..29747a4 100644 --- a/src/Trace/Parser.php +++ b/src/Trace/Parser.php @@ -10,7 +10,7 @@ public function __construct(protected ?string $trace = '') { } - public function parse(): ?array + public function parse() : ?array { $frames = explode("\n", $this->trace); @@ -22,6 +22,7 @@ public function parse(): ?array /** * {@inheritDoc} */ + #[\ReturnTypeWillChange] public function current() { // TODO: Implement current() method. @@ -30,6 +31,7 @@ public function current() /** * {@inheritDoc} */ + #[\ReturnTypeWillChange] public function next() { // TODO: Implement next() method. @@ -38,6 +40,7 @@ public function next() /** * {@inheritDoc} */ + #[\ReturnTypeWillChange] public function key() { // TODO: Implement key() method. @@ -46,6 +49,7 @@ public function key() /** * {@inheritDoc} */ + #[\ReturnTypeWillChange] public function valid() { // TODO: Implement valid() method. @@ -54,6 +58,7 @@ public function valid() /** * {@inheritDoc} */ + #[\ReturnTypeWillChange] public function rewind() { // TODO: Implement rewind() method. From 0a56f0aaf19ddc553f829c222aa6f23928d2efd8 Mon Sep 17 00:00:00 2001 From: Dylan Marriott <11637247+Fludem@users.noreply.github.com> Date: Mon, 22 Jan 2024 16:03:19 +0000 Subject: [PATCH 10/28] workflow dependency update --- .github/workflows/run-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 2a21df5..e07ee6b 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -18,7 +18,7 @@ jobs: stability: [prefer-lowest, prefer-stable] include: - laravel: 9.* - testbench: 7.* + testbench: 8.* name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} From 90654411a5f034b20a5e9bdb77cb2d0ebe6261f9 Mon Sep 17 00:00:00 2001 From: Bezhan Salleh Date: Mon, 22 Jan 2024 21:13:56 +0430 Subject: [PATCH 11/28] Update run-tests.yml --- .github/workflows/run-tests.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 2a21df5..e965c95 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -14,9 +14,11 @@ jobs: matrix: os: [ubuntu-latest, windows-latest] php: [8.1] - laravel: [9.*] + laravel: [9.*,10.*] stability: [prefer-lowest, prefer-stable] include: + - laravel: 10.* + testbench: 8.* - laravel: 9.* testbench: 7.* From 5932c3a1d23da2a62516291032922ac500527794 Mon Sep 17 00:00:00 2001 From: bezhanSalleh Date: Mon, 22 Jan 2024 16:44:19 +0000 Subject: [PATCH 12/28] Fix styling --- src/Trace/Frame.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Trace/Frame.php b/src/Trace/Frame.php index 7f2d18f..c660f69 100644 --- a/src/Trace/Frame.php +++ b/src/Trace/Frame.php @@ -53,7 +53,7 @@ public function parseCall($str) if (str()->contains($matches[2], ['{closure}']) && Arr::get($this->attributes, 'name') == '[internal function]') { $this->attributes['name'] .= " $matches[1]->$matches[2]"; } - // class method call + // class method call } else { preg_match('/([^(]+)\((.*)\)/', $str, $matches); $this->attributes['function'] = $matches[1]; From aae8840b781e2dc36edee3618bfc94cf5146b588 Mon Sep 17 00:00:00 2001 From: Bezhan Salleh Date: Mon, 22 Jan 2024 21:16:44 +0430 Subject: [PATCH 13/28] Update run-tests.yml --- .github/workflows/run-tests.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index e965c95..1d6a6bc 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -19,8 +19,6 @@ jobs: include: - laravel: 10.* testbench: 8.* - - laravel: 9.* - testbench: 7.* name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} From 4f4bf6500abb7829f6ba1d7e0f4ec7230ef96132 Mon Sep 17 00:00:00 2001 From: Bezhan Salleh Date: Mon, 22 Jan 2024 21:18:15 +0430 Subject: [PATCH 14/28] Update run-tests.yml --- .github/workflows/run-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 1d6a6bc..6abcfec 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -14,7 +14,7 @@ jobs: matrix: os: [ubuntu-latest, windows-latest] php: [8.1] - laravel: [9.*,10.*] + laravel: [10.*] stability: [prefer-lowest, prefer-stable] include: - laravel: 10.* From 3167f26caa43cdc1f87e16ed20005b74bd5129fd Mon Sep 17 00:00:00 2001 From: Dylan Marriott <11637247+Fludem@users.noreply.github.com> Date: Mon, 22 Jan 2024 17:09:56 +0000 Subject: [PATCH 15/28] Update Laravel version to 10.0 in run-tests.yml --- .github/workflows/run-tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index e07ee6b..46a6f73 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -14,10 +14,10 @@ jobs: matrix: os: [ubuntu-latest, windows-latest] php: [8.1] - laravel: [9.*] + laravel: [10.*] stability: [prefer-lowest, prefer-stable] include: - - laravel: 9.* + - laravel: 10.* testbench: 8.* name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} @@ -44,4 +44,4 @@ jobs: composer update --${{ matrix.stability }} --prefer-dist --no-interaction - name: Execute tests - run: vendor/bin/pest + run: vendor/bin/pest \ No newline at end of file From 82765c52163044f777e79b9b897bd452ce30886a Mon Sep 17 00:00:00 2001 From: Dylan Marriott <11637247+Fludem@users.noreply.github.com> Date: Mon, 22 Jan 2024 17:17:47 +0000 Subject: [PATCH 16/28] reverted prune period back to 1 week that was accidentally changed --- config/filament-exceptions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/filament-exceptions.php b/config/filament-exceptions.php index 13e221b..523d05f 100644 --- a/config/filament-exceptions.php +++ b/config/filament-exceptions.php @@ -52,5 +52,5 @@ * */ - 'period' => now()->subDays(5), + 'period' => now()->subWeek(), ]; From c4c2fca71de07258fad2b446abfeacdf2555d631 Mon Sep 17 00:00:00 2001 From: MinnShinSawLingMyat Date: Tue, 23 Jan 2024 14:31:07 +0630 Subject: [PATCH 17/28] Adding isScopedToTenant at ExceptionResource --- config/filament-exceptions.php | 3 +++ src/Resources/ExceptionResource.php | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/config/filament-exceptions.php b/config/filament-exceptions.php index 35bb664..a766005 100644 --- a/config/filament-exceptions.php +++ b/config/filament-exceptions.php @@ -13,6 +13,9 @@ /** Whether to show a navigation badge. No effect, if navigation_enabled it set to false. */ 'navigation_badge' => true, + /** Whether to scope exceptions to tenant */ + 'is_scoped_to_tenant' => true, + /** Icons to use for navigation (if enabled) and pills */ 'icons' => [ 'navigation' => 'heroicon-o-cpu-chip', diff --git a/src/Resources/ExceptionResource.php b/src/Resources/ExceptionResource.php index d090b9e..b19dda9 100644 --- a/src/Resources/ExceptionResource.php +++ b/src/Resources/ExceptionResource.php @@ -63,6 +63,11 @@ public static function getNavigationSort(): ?int return config('filament-exceptions.navigation_sort'); } + public static function isScopedToTenant(): bool + { + return config('filament-exceptions.is_scoped_to_tenant', true); + } + public static function canGloballySearch(): bool { return config('filament-exceptions.is_globally_searchable') From 91f3b23cb4467df4a6b1cada0028d82332ffd31c Mon Sep 17 00:00:00 2001 From: bezhanSalleh Date: Wed, 24 Jan 2024 17:22:56 +0000 Subject: [PATCH 18/28] Fix styling --- src/FilamentExceptions.php | 15 +++--- src/Resources/ExceptionResource.php | 77 ++++++++++++++--------------- src/Trace/Parser.php | 2 +- 3 files changed, 45 insertions(+), 49 deletions(-) diff --git a/src/FilamentExceptions.php b/src/FilamentExceptions.php index b13d842..95c0608 100755 --- a/src/FilamentExceptions.php +++ b/src/FilamentExceptions.php @@ -2,7 +2,6 @@ namespace BezhanSalleh\FilamentExceptions; - use BezhanSalleh\FilamentExceptions\Models\Exception as ExceptionModel; use Illuminate\Foundation\Application; use Illuminate\Http\Request; @@ -37,11 +36,12 @@ public static function report(Throwable $exception) $reporter->reportException($exception); } - public static function model() : string + public static function model(): string { if (config('filament-exceptions.exception_model') === null) { return ExceptionModel::class; } + return config('filament-exceptions.exception_model'); } @@ -71,8 +71,7 @@ public function reportException(Throwable $exception) try { $this->store($data); - } - catch (Throwable $e) { + } catch (Throwable $e) { throw $e; } } @@ -80,7 +79,7 @@ public function reportException(Throwable $exception) /** * Convert all items to string. */ - public function stringify($data) : array + public function stringify($data): array { return array_map(function ($item) { return is_array($item) ? json_encode($item, JSON_OBJECT_AS_ARRAY) : (string) $item; @@ -90,16 +89,14 @@ public function stringify($data) : array /** * Store exception info to db. */ - public function store(array $data) : bool + public function store(array $data): bool { try { $this->model()::query()->create($data); return true; - } - catch (Throwable $e) { + } catch (Throwable $e) { return false; } } - } diff --git a/src/Resources/ExceptionResource.php b/src/Resources/ExceptionResource.php index c2465f9..1aa8747 100644 --- a/src/Resources/ExceptionResource.php +++ b/src/Resources/ExceptionResource.php @@ -12,43 +12,42 @@ class ExceptionResource extends Resource { - - public static function getModel() : string + public static function getModel(): string { return FilamentExceptions::model(); } - public static function getModelLabel() : string + public static function getModelLabel(): string { return __('filament-exceptions::filament-exceptions.labels.model'); } - public static function getPluralModelLabel() : string + public static function getPluralModelLabel(): string { return __('filament-exceptions::filament-exceptions.labels.model_plural'); } - public static function getNavigationGroup() : ?string + public static function getNavigationGroup(): ?string { return __('filament-exceptions::filament-exceptions.labels.navigation_group'); } - public static function getNavigationLabel() : string + public static function getNavigationLabel(): string { return __('filament-exceptions::filament-exceptions.labels.navigation'); } - public static function getNavigationIcon() : string + public static function getNavigationIcon(): string { return config('filament-exceptions.icons.navigation'); } - public static function getSlug() : string + public static function getSlug(): string { return config('filament-exceptions.slug'); } - public static function getNavigationBadge() : ?string + public static function getNavigationBadge(): ?string { if (config('filament-exceptions.navigation_badge')) { return static::getModel()::count(); @@ -57,12 +56,12 @@ public static function getNavigationBadge() : ?string return null; } - public static function shouldRegisterNavigation() : bool + public static function shouldRegisterNavigation(): bool { return (bool) config('filament-exceptions.navigation_enabled'); } - public static function getNavigationSort() : ?int + public static function getNavigationSort(): ?int { return config('filament-exceptions.navigation_sort'); } @@ -79,41 +78,41 @@ public static function canGloballySearch(): bool && static::canViewAny(); } - public static function form(Form $form) : Form + public static function form(Form $form): Form { return $form ->schema([ Forms\Components\Tabs::make('Heading') - ->activeTab(static fn () : int => config('filament-exceptions.active_tab')) + ->activeTab(static fn (): int => config('filament-exceptions.active_tab')) ->tabs([ Forms\Components\Tabs\Tab::make('Exception') - ->label(static fn () : string => __('filament-exceptions::filament-exceptions.labels.tabs.exception')) - ->icon(static fn () : string => config('filament-exceptions.icons.exception')) + ->label(static fn (): string => __('filament-exceptions::filament-exceptions.labels.tabs.exception')) + ->icon(static fn (): string => config('filament-exceptions.icons.exception')) ->schema([ Forms\Components\View::make('filament-exceptions::exception'), ]), Forms\Components\Tabs\Tab::make('Headers') - ->label(static fn () : string => __('filament-exceptions::filament-exceptions.labels.tabs.headers')) - ->icon(static fn () : string => config('filament-exceptions.icons.headers')) + ->label(static fn (): string => __('filament-exceptions::filament-exceptions.labels.tabs.headers')) + ->icon(static fn (): string => config('filament-exceptions.icons.headers')) ->schema([ Forms\Components\View::make('filament-exceptions::headers'), ])->columns(1), Forms\Components\Tabs\Tab::make('Cookies') - ->label(static fn () : string => __('filament-exceptions::filament-exceptions.labels.tabs.cookies')) - ->icon(static fn () : string => config('filament-exceptions.icons.cookies')) + ->label(static fn (): string => __('filament-exceptions::filament-exceptions.labels.tabs.cookies')) + ->icon(static fn (): string => config('filament-exceptions.icons.cookies')) ->schema([ Forms\Components\View::make('filament-exceptions::cookies'), ]), Forms\Components\Tabs\Tab::make('Body') - ->label(static fn () : string => __('filament-exceptions::filament-exceptions.labels.tabs.body')) - ->icon(static fn () : string => config('filament-exceptions.icons.body')) + ->label(static fn (): string => __('filament-exceptions::filament-exceptions.labels.tabs.body')) + ->icon(static fn (): string => config('filament-exceptions.icons.body')) ->schema([ Forms\Components\View::make('filament-exceptions::body'), ]), Forms\Components\Tabs\Tab::make('Queries') - ->label(static fn () : string => __('filament-exceptions::filament-exceptions.labels.tabs.queries')) - ->icon(static fn () : string => config('filament-exceptions.icons.queries')) - ->badge(static fn ($record) : string => collect(json_decode($record->query, true, 512, JSON_THROW_ON_ERROR))->count()) + ->label(static fn (): string => __('filament-exceptions::filament-exceptions.labels.tabs.queries')) + ->icon(static fn (): string => config('filament-exceptions.icons.queries')) + ->badge(static fn ($record): string => collect(json_decode($record->query, true, 512, JSON_THROW_ON_ERROR))->count()) ->schema([ Forms\Components\View::make('filament-exceptions::query'), ]), @@ -122,46 +121,46 @@ public static function form(Form $form) : Form ])->columns(1); } - public static function table(Table $table) : Table + public static function table(Table $table): Table { return $table ->columns([ Tables\Columns\TextColumn::make('method') - ->label(fn () : string => __('filament-exceptions::filament-exceptions.columns.method')) + ->label(fn (): string => __('filament-exceptions::filament-exceptions.columns.method')) ->badge() ->colors([ 'gray', - 'success' => fn ($state) : bool => $state === 'GET', - 'primary' => fn ($state) : bool => $state === 'POST', - 'warning' => fn ($state) : bool => $state === 'PUT', - 'danger' => fn ($state) : bool => $state === 'DELETE', - 'warning' => fn ($state) : bool => $state === 'PATCH', - 'gray' => fn ($state) : bool => $state === 'OPTIONS', + 'success' => fn ($state): bool => $state === 'GET', + 'primary' => fn ($state): bool => $state === 'POST', + 'warning' => fn ($state): bool => $state === 'PUT', + 'danger' => fn ($state): bool => $state === 'DELETE', + 'warning' => fn ($state): bool => $state === 'PATCH', + 'gray' => fn ($state): bool => $state === 'OPTIONS', ]) ->searchable() ->sortable(), Tables\Columns\TextColumn::make('path') - ->label(fn () : string => __('filament-exceptions::filament-exceptions.columns.path')) + ->label(fn (): string => __('filament-exceptions::filament-exceptions.columns.path')) ->searchable(), Tables\Columns\TextColumn::make('type') - ->label(fn () : string => __('filament-exceptions::filament-exceptions.columns.type')) + ->label(fn (): string => __('filament-exceptions::filament-exceptions.columns.type')) ->sortable() ->searchable(), Tables\Columns\TextColumn::make('code') - ->label(fn () : string => __('filament-exceptions::filament-exceptions.columns.code')) + ->label(fn (): string => __('filament-exceptions::filament-exceptions.columns.code')) ->searchable() ->sortable() ->toggleable(isToggledHiddenByDefault: false), Tables\Columns\TextColumn::make('ip') - ->label(fn () : string => __('filament-exceptions::filament-exceptions.columns.ip')) + ->label(fn (): string => __('filament-exceptions::filament-exceptions.columns.ip')) ->badge() ->extraAttributes(['class' => 'font-mono']) ->sortable() ->searchable() ->toggleable(isToggledHiddenByDefault: false), Tables\Columns\TextColumn::make('created_at') - ->label(fn () : string => __('filament-exceptions::filament-exceptions.columns.occurred_at')) + ->label(fn (): string => __('filament-exceptions::filament-exceptions.columns.occurred_at')) ->sortable() ->searchable() ->dateTime() @@ -182,14 +181,14 @@ public static function table(Table $table) : Table ->defaultSort('created_at', 'desc'); } - public static function getRelations() : array + public static function getRelations(): array { return [ // ]; } - public static function getPages() : array + public static function getPages(): array { return [ 'index' => Pages\ListExceptions::route('/'), diff --git a/src/Trace/Parser.php b/src/Trace/Parser.php index 29747a4..e482cfd 100644 --- a/src/Trace/Parser.php +++ b/src/Trace/Parser.php @@ -10,7 +10,7 @@ public function __construct(protected ?string $trace = '') { } - public function parse() : ?array + public function parse(): ?array { $frames = explode("\n", $this->trace); From 524de3daef68f36f559d57c6c5ea074561762c7e Mon Sep 17 00:00:00 2001 From: Bezhan Salleh Date: Wed, 24 Jan 2024 23:20:58 +0430 Subject: [PATCH 19/28] adjust prs --- composer.json | 2 +- src/Facades/FilamentExceptions.php | 6 ++++ src/FilamentExceptions.php | 46 +++++++---------------------- src/Resources/ExceptionResource.php | 4 +-- 4 files changed, 20 insertions(+), 38 deletions(-) diff --git a/composer.json b/composer.json index 3779e25..034f2c4 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ "require-dev": { "laravel/pint": "^1.0", "nunomaduro/collision": "^7.0", - "nunomaduro/larastan": "^2.0", + "larastan/larastan": "^2.0", "orchestra/testbench": "^8.0", "pestphp/pest": "^2.9", "phpunit/phpunit": "^10.0", diff --git a/src/Facades/FilamentExceptions.php b/src/Facades/FilamentExceptions.php index 77eab26..add012f 100644 --- a/src/Facades/FilamentExceptions.php +++ b/src/Facades/FilamentExceptions.php @@ -5,6 +5,12 @@ use Illuminate\Support\Facades\Facade; /** + * @method static void report(\Throwable $exception) + * @method static string getModel() + * @method static void reportException(\Throwable $exception) + * @method static array stringify(void $data) + * @method static bool store(array $data) + * * @see \BezhanSalleh\FilamentExceptions\FilamentExceptions */ class FilamentExceptions extends Facade diff --git a/src/FilamentExceptions.php b/src/FilamentExceptions.php index 95c0608..3aa03c6 100755 --- a/src/FilamentExceptions.php +++ b/src/FilamentExceptions.php @@ -3,6 +3,7 @@ namespace BezhanSalleh\FilamentExceptions; use BezhanSalleh\FilamentExceptions\Models\Exception as ExceptionModel; +use Illuminate\Contracts\Container\BindingResolutionException; use Illuminate\Foundation\Application; use Illuminate\Http\Request; use Illuminate\Support\Arr; @@ -11,44 +12,30 @@ class FilamentExceptions { - /** - * @var Request - */ - protected $request; - - protected Application $app; - - /** - * Reporter constructor. - */ - public function __construct(Request $request) - { - $this->request = $request; + public function __construct( + protected Request $request + ) { } /** - * @return void + * @throws BindingResolutionException */ - public static function report(Throwable $exception) + public static function report(Throwable $exception): void { $reporter = new static(request()); $reporter->reportException($exception); } - public static function model(): string + public static function getModel(): string { - if (config('filament-exceptions.exception_model') === null) { - return ExceptionModel::class; - } - - return config('filament-exceptions.exception_model'); + return config('filament-exceptions.exception_model') ?? ExceptionModel::class; } /** - * @return void + * @throws BindingResolutionException */ - public function reportException(Throwable $exception) + public function reportException(Throwable $exception): void { $data = [ 'method' => request()->getMethod(), @@ -69,16 +56,9 @@ public function reportException(Throwable $exception) $data = $this->stringify($data); - try { - $this->store($data); - } catch (Throwable $e) { - throw $e; - } + $this->store($data); } - /** - * Convert all items to string. - */ public function stringify($data): array { return array_map(function ($item) { @@ -86,14 +66,10 @@ public function stringify($data): array }, $data); } - /** - * Store exception info to db. - */ public function store(array $data): bool { try { $this->model()::query()->create($data); - return true; } catch (Throwable $e) { return false; diff --git a/src/Resources/ExceptionResource.php b/src/Resources/ExceptionResource.php index 1aa8747..74bc671 100644 --- a/src/Resources/ExceptionResource.php +++ b/src/Resources/ExceptionResource.php @@ -14,7 +14,7 @@ class ExceptionResource extends Resource { public static function getModel(): string { - return FilamentExceptions::model(); + return FilamentExceptions::getModel(); } public static function getModelLabel(): string @@ -50,7 +50,7 @@ public static function getSlug(): string public static function getNavigationBadge(): ?string { if (config('filament-exceptions.navigation_badge')) { - return static::getModel()::count(); + return static::getEloquentQuery()->count(); } return null; From 3270605c79d7162ea9c07da948c74f3f5f1ea059 Mon Sep 17 00:00:00 2001 From: bezhanSalleh Date: Wed, 24 Jan 2024 18:51:32 +0000 Subject: [PATCH 20/28] Fix styling --- src/FilamentExceptions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FilamentExceptions.php b/src/FilamentExceptions.php index 3aa03c6..6b2e55b 100755 --- a/src/FilamentExceptions.php +++ b/src/FilamentExceptions.php @@ -4,7 +4,6 @@ use BezhanSalleh\FilamentExceptions\Models\Exception as ExceptionModel; use Illuminate\Contracts\Container\BindingResolutionException; -use Illuminate\Foundation\Application; use Illuminate\Http\Request; use Illuminate\Support\Arr; use Spatie\LaravelIgnition\Recorders\QueryRecorder\QueryRecorder; @@ -70,6 +69,7 @@ public function store(array $data): bool { try { $this->model()::query()->create($data); + return true; } catch (Throwable $e) { return false; From 24aafd4a85e9b37ccf0f6f47e70fc1f43af7a421 Mon Sep 17 00:00:00 2001 From: bezhanSalleh Date: Wed, 24 Jan 2024 18:52:57 +0000 Subject: [PATCH 21/28] Update CHANGELOG --- CHANGELOG.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c37b6f8..a59d70e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,20 @@ All notable changes to `filament-exceptions` will be documented in this file. +## 2.1.0 - 2024-01-24 + +### What's Changed + +* Adding isScopedToTenant at ExceptionResource by @LingMyat in https://github.com/bezhanSalleh/filament-exceptions/pull/47 +* Add Custom Model Support & Fix Iterator Errors by @Fludem in https://github.com/bezhanSalleh/filament-exceptions/pull/46 + +### New Contributors + +* @LingMyat made their first contribution in https://github.com/bezhanSalleh/filament-exceptions/pull/47 +* @Fludem made their first contribution in https://github.com/bezhanSalleh/filament-exceptions/pull/46 + +**Full Changelog**: https://github.com/bezhanSalleh/filament-exceptions/compare/2.0.2...2.1.0 + ## 2.0.2 - 2024-01-09 ### What's Changed From c008b7cd6b3c9c0cd694b35fa8778c1358834401 Mon Sep 17 00:00:00 2001 From: Bezhan Salleh Date: Thu, 25 Jan 2024 21:10:51 +0430 Subject: [PATCH 22/28] fix model instance --- src/FilamentExceptions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FilamentExceptions.php b/src/FilamentExceptions.php index 6b2e55b..3d0bfe4 100755 --- a/src/FilamentExceptions.php +++ b/src/FilamentExceptions.php @@ -68,7 +68,7 @@ public function stringify($data): array public function store(array $data): bool { try { - $this->model()::query()->create($data); + static::getModel()::create($data); return true; } catch (Throwable $e) { From 9e136150228190292c990d326758b4a5ba2c00bc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Apr 2024 10:05:05 +0000 Subject: [PATCH 23/28] Bump aglipanci/laravel-pint-action from 2.3.1 to 2.4 Bumps [aglipanci/laravel-pint-action](https://github.com/aglipanci/laravel-pint-action) from 2.3.1 to 2.4. - [Release notes](https://github.com/aglipanci/laravel-pint-action/releases) - [Commits](https://github.com/aglipanci/laravel-pint-action/compare/2.3.1...2.4) --- updated-dependencies: - dependency-name: aglipanci/laravel-pint-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/fix-php-code-style-issues.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fix-php-code-style-issues.yml b/.github/workflows/fix-php-code-style-issues.yml index 7f61fce..9384d28 100644 --- a/.github/workflows/fix-php-code-style-issues.yml +++ b/.github/workflows/fix-php-code-style-issues.yml @@ -13,7 +13,7 @@ jobs: ref: ${{ github.head_ref }} - name: Fix PHP code style issues - uses: aglipanci/laravel-pint-action@2.3.1 + uses: aglipanci/laravel-pint-action@2.4 - name: Commit changes uses: stefanzweifel/git-auto-commit-action@v5 From 09abd872efaf54cc5d8fd37a9f315da7780d996f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Hamr=C3=A1k?= Date: Fri, 17 May 2024 12:31:36 +0200 Subject: [PATCH 24/28] Slovak translation --- resources/lang/sk/filament-exceptions.php | 31 +++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 resources/lang/sk/filament-exceptions.php diff --git a/resources/lang/sk/filament-exceptions.php b/resources/lang/sk/filament-exceptions.php new file mode 100644 index 0000000..c53c27a --- /dev/null +++ b/resources/lang/sk/filament-exceptions.php @@ -0,0 +1,31 @@ + [ + 'model' => 'Výnimka', + 'model_plural' => 'Výnimky', + 'navigation' => 'Výnimka', + 'navigation_group' => 'Nastavenia', + + 'tabs' => [ + 'exception' => 'Výnimka', + 'headers' => 'Hlavičky', + 'cookies' => 'Cookies', + 'body' => 'Telo', + 'queries' => 'Dotazy', + ], + ], + + 'empty_list' => 'Hurá! len si sadnite a užívajte si 😎', + + 'columns' => [ + 'method' => 'Metóda', + 'path' => 'Cesta', + 'type' => 'Typ', + 'code' => 'Kód', + 'ip' => 'IP', + 'occurred_at' => 'Nastalo o', + ], + +]; From 0be3e8e45cd407fb8dc8a05ec67425f0cf9f5a30 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Jul 2024 10:56:49 +0000 Subject: [PATCH 25/28] Bump dependabot/fetch-metadata from 1.6.0 to 2.2.0 Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 1.6.0 to 2.2.0. - [Release notes](https://github.com/dependabot/fetch-metadata/releases) - [Commits](https://github.com/dependabot/fetch-metadata/compare/v1.6.0...v2.2.0) --- updated-dependencies: - dependency-name: dependabot/fetch-metadata dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/dependabot-auto-merge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml index ca2197d..eb537d8 100644 --- a/.github/workflows/dependabot-auto-merge.yml +++ b/.github/workflows/dependabot-auto-merge.yml @@ -13,7 +13,7 @@ jobs: - name: Dependabot metadata id: metadata - uses: dependabot/fetch-metadata@v1.6.0 + uses: dependabot/fetch-metadata@v2.2.0 with: github-token: "${{ secrets.GITHUB_TOKEN }}" From 9d2ae2728d4a4119ae203eae468e362cc8bfb1fa Mon Sep 17 00:00:00 2001 From: bezhanSalleh Date: Wed, 6 Nov 2024 07:05:33 +0000 Subject: [PATCH 26/28] Fix styling --- bootstrap/app.php | 2 +- src/FilamentExceptions.php | 3 +-- src/Trace/Frame.php | 4 ++-- src/Trace/Parser.php | 4 +--- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/bootstrap/app.php b/bootstrap/app.php index 4ec046e..b3e010b 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -6,7 +6,7 @@ use Orchestra\Testbench\Concerns\CreatesApplication; use Orchestra\Testbench\Foundation\Application; -$basePathLocator = new class() +$basePathLocator = new class { use CreatesApplication; }; diff --git a/src/FilamentExceptions.php b/src/FilamentExceptions.php index 3d0bfe4..62dcbdc 100755 --- a/src/FilamentExceptions.php +++ b/src/FilamentExceptions.php @@ -13,8 +13,7 @@ class FilamentExceptions { public function __construct( protected Request $request - ) { - } + ) {} /** * @throws BindingResolutionException diff --git a/src/Trace/Frame.php b/src/Trace/Frame.php index c660f69..1f1a0f6 100644 --- a/src/Trace/Frame.php +++ b/src/Trace/Frame.php @@ -118,10 +118,10 @@ public function fetchCodeBlock() public function getCodeBlock(): array | CodeBlock { if (empty($this->code)) { - return new CodeBlock(); + return new CodeBlock; } - return $this->code ?: new CodeBlock(); + return $this->code ?: new CodeBlock; } public function method() diff --git a/src/Trace/Parser.php b/src/Trace/Parser.php index e482cfd..9d0c203 100644 --- a/src/Trace/Parser.php +++ b/src/Trace/Parser.php @@ -6,9 +6,7 @@ class Parser implements Iterator { - public function __construct(protected ?string $trace = '') - { - } + public function __construct(protected ?string $trace = '') {} public function parse(): ?array { From e3cc5c29ec5d4cf4f43285307dc4856b8564f0f6 Mon Sep 17 00:00:00 2001 From: Bezhan Salleh Date: Wed, 6 Nov 2024 08:07:41 +0100 Subject: [PATCH 27/28] resovles #58 --- resources/views/components/query-preview.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/components/query-preview.blade.php b/resources/views/components/query-preview.blade.php index 011b020..c01934c 100644 --- a/resources/views/components/query-preview.blade.php +++ b/resources/views/components/query-preview.blade.php @@ -34,7 +34,7 @@ class="flex items-center px-2 py-1 text-xs font-medium transition duration-75 ro class="w-full overflow-hidden rounded-lg bg-gray-50 dark:bg-gray-900 dark:border dark:border-gray-800"> @foreach ($query['bindings'] as $key => $value)
-
{{ $key + 1 }} +
{{ intVal($key) + 1 }}
From 7c712a616f80ab4c9da15df5579eab2afec11477 Mon Sep 17 00:00:00 2001 From: bezhanSalleh Date: Wed, 6 Nov 2024 07:12:18 +0000 Subject: [PATCH 28/28] Update CHANGELOG --- CHANGELOG.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a59d70e..9d2d47d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,24 @@ All notable changes to `filament-exceptions` will be documented in this file. +## 2.1.2 - 2024-11-06 + +### What's Changed + +* Adding isScopedToTenant at ExceptionResource by @LingMyat in https://github.com/bezhanSalleh/filament-exceptions/pull/47 +* Add Custom Model Support & Fix Iterator Errors by @Fludem in https://github.com/bezhanSalleh/filament-exceptions/pull/46 +* Bump aglipanci/laravel-pint-action from 2.3.1 to 2.4 by @dependabot in https://github.com/bezhanSalleh/filament-exceptions/pull/53 +* Slovak translation by @hamrak in https://github.com/bezhanSalleh/filament-exceptions/pull/55 +* Bump dependabot/fetch-metadata from 1.6.0 to 2.2.0 by @dependabot in https://github.com/bezhanSalleh/filament-exceptions/pull/59 + +### New Contributors + +* @LingMyat made their first contribution in https://github.com/bezhanSalleh/filament-exceptions/pull/47 +* @Fludem made their first contribution in https://github.com/bezhanSalleh/filament-exceptions/pull/46 +* @hamrak made their first contribution in https://github.com/bezhanSalleh/filament-exceptions/pull/55 + +**Full Changelog**: https://github.com/bezhanSalleh/filament-exceptions/compare/2.0.2...2.1.2 + ## 2.1.0 - 2024-01-24 ### What's Changed