Add Laravel/Filament Log Viewer (#1778)

Co-authored-by: Boy132 <Boy132@users.noreply.github.com>
This commit is contained in:
Charles 2025-10-08 06:18:20 -04:00 committed by GitHub
parent dbe4bdd62d
commit 05f3422dda
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 97 additions and 3 deletions

View File

@ -49,6 +49,9 @@ class Role extends BaseRole
'activityLog' => [
'seeIps',
],
'panelLog' => [
'view',
],
];
/** @var array<string, array<string>> */

View File

@ -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'),
]);
}
}

View File

@ -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),
]);
}
}

View File

@ -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",

80
composer.lock generated
View File

@ -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",