diff --git a/app/Models/Role.php b/app/Models/Role.php index a968dd78d..5d4d16d8d 100644 --- a/app/Models/Role.php +++ b/app/Models/Role.php @@ -49,6 +49,9 @@ class Role extends BaseRole 'activityLog' => [ 'seeIps', ], + 'panelLog' => [ + 'view', + ], ]; /** @var array> */ diff --git a/app/Providers/Filament/AdminPanelProvider.php b/app/Providers/Filament/AdminPanelProvider.php index 981f7e53c..5e5f3ef58 100644 --- a/app/Providers/Filament/AdminPanelProvider.php +++ b/app/Providers/Filament/AdminPanelProvider.php @@ -2,6 +2,7 @@ namespace App\Providers\Filament; +use AchyutN\FilamentLogViewer\FilamentLogViewer; use Filament\Actions\Action; use Filament\Facades\Filament; use Filament\Navigation\NavigationGroup; @@ -32,6 +33,12 @@ class AdminPanelProvider extends PanelProvider ]) ->discoverResources(in: app_path('Filament/Admin/Resources'), for: 'App\\Filament\\Admin\\Resources') ->discoverPages(in: app_path('Filament/Admin/Pages'), for: 'App\\Filament\\Admin\\Pages') - ->discoverWidgets(in: app_path('Filament/Admin/Widgets'), for: 'App\\Filament\\Admin\\Widgets'); + ->discoverWidgets(in: app_path('Filament/Admin/Widgets'), for: 'App\\Filament\\Admin\\Widgets') + ->plugins([ + FilamentLogViewer::make() + ->authorize(fn () => user()->can('view panelLog')) + ->navigationGroup(fn () => trans('admin/dashboard.advanced')) + ->navigationIcon('tabler-file-info'), + ]); } } diff --git a/app/Providers/Filament/AppPanelProvider.php b/app/Providers/Filament/AppPanelProvider.php index b37e65619..8e5120bea 100644 --- a/app/Providers/Filament/AppPanelProvider.php +++ b/app/Providers/Filament/AppPanelProvider.php @@ -2,6 +2,7 @@ namespace App\Providers\Filament; +use AchyutN\FilamentLogViewer\FilamentLogViewer; use Filament\Actions\Action; use Filament\Facades\Filament; use Filament\Panel; @@ -22,6 +23,10 @@ class AppPanelProvider extends PanelProvider ->icon('tabler-arrow-forward') ->visible(fn () => user()?->canAccessPanel(Filament::getPanel('admin'))), ]) - ->discoverResources(in: app_path('Filament/App/Resources'), for: 'App\\Filament\\App\\Resources'); + ->discoverResources(in: app_path('Filament/App/Resources'), for: 'App\\Filament\\App\\Resources') + ->plugins([ + FilamentLogViewer::make() + ->authorize(false), + ]); } } diff --git a/composer.json b/composer.json index f38583f74..2ec143982 100644 --- a/composer.json +++ b/composer.json @@ -9,6 +9,7 @@ "ext-mbstring": "*", "ext-pdo": "*", "ext-zip": "*", + "achyutn/filament-log-viewer": "^1.4", "aws/aws-sdk-php": "^3.356", "calebporzio/sushi": "^2.5", "dedoc/scramble": "^0.12.10", diff --git a/composer.lock b/composer.lock index 86077619e..48352c13c 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,86 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "77cf4449e7671237bbb750d1f2b793fb", + "content-hash": "3328aca72bd324cc9cbf98653b782e5f", "packages": [ + { + "name": "achyutn/filament-log-viewer", + "version": "v1.4.5", + "source": { + "type": "git", + "url": "https://github.com/achyutkneupane/filament-log-viewer.git", + "reference": "a9bcf3ad58f17ccb6a58aa13bea6dd9196a2f23f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/achyutkneupane/filament-log-viewer/zipball/a9bcf3ad58f17ccb6a58aa13bea6dd9196a2f23f", + "reference": "a9bcf3ad58f17ccb6a58aa13bea6dd9196a2f23f", + "shasum": "" + }, + "require": { + "filament/filament": "^4.0", + "php": ">=8.2" + }, + "require-dev": { + "laravel/pint": "^1.23", + "orchestra/testbench": "^10.4", + "pestphp/pest": "^3.8", + "pestphp/pest-plugin-laravel": "^3.2", + "pestphp/pest-plugin-livewire": "^3.0", + "rector/rector": "^2.1" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "AchyutN\\FilamentLogViewer\\LogViewerProvider" + ] + } + }, + "autoload": { + "psr-4": { + "AchyutN\\FilamentLogViewer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Achyut Neupane", + "email": "achyutkneupane@gmail.com", + "homepage": "https://achyut.com.np", + "role": "Maintainer" + } + ], + "description": "A Filament package to view and manage Laravel logs.", + "keywords": [ + "Viewer", + "filament", + "laravel", + "log" + ], + "support": { + "issues": "https://github.com/achyutkneupane/filament-log-viewer/issues", + "source": "https://github.com/achyutkneupane/filament-log-viewer/tree/v1.4.5" + }, + "funding": [ + { + "url": "https://www.buymeacoffee.com/achyutn", + "type": "buy_me_a_coffee" + }, + { + "url": "https://github.com/achyutkneupane", + "type": "github" + }, + { + "url": "https://www.patreon.com/Achyut", + "type": "patreon" + } + ], + "time": "2025-10-03T19:38:47+00:00" + }, { "name": "anourvalar/eloquent-serialize", "version": "1.3.4",