From 3f2537af7df1ff4a525b6c4db797b0effc9454b8 Mon Sep 17 00:00:00 2001 From: Yoga Pangestu Date: Thu, 29 Jan 2026 15:43:40 +0700 Subject: [PATCH] feat: Add Filament log viewer integration with new permissions and navigation. --- .../Filament/DashboardPanelProvider.php | 10 ++ composer.json | 1 + composer.lock | 158 +++++++++++++++++- database/seeders/ShieldSeeder.php | 2 + 4 files changed, 170 insertions(+), 1 deletion(-) diff --git a/app/Providers/Filament/DashboardPanelProvider.php b/app/Providers/Filament/DashboardPanelProvider.php index 877ff9a..0915342 100644 --- a/app/Providers/Filament/DashboardPanelProvider.php +++ b/app/Providers/Filament/DashboardPanelProvider.php @@ -2,6 +2,7 @@ namespace App\Providers\Filament; +use AchyutN\FilamentLogViewer\FilamentLogViewer; use App\Filament\Pages\Auth\EmailVerification; use App\Filament\Pages\Auth\Login; use App\Filament\Pages\Auth\Registration; @@ -94,6 +95,14 @@ public function panel(Panel $panel): Panel MyImages::make() ->directory('storage/'.$directoryAuthBg) ), + + FilamentLogViewer::make() + ->navigationGroup('Sistem') + ->navigationIcon('heroicon-o-server-stack') + ->navigationLabel('Log') + ->navigationUrl('/system/logs') + ->pollingTime(null) + ->authorize(fn (): bool => auth()->user()->can('View:LogTable')), ]) ->authMiddleware([ Authenticate::class, @@ -107,6 +116,7 @@ public function panel(Panel $panel): Panel 'Publikasi', 'Pengaturan', 'Pelindung', + 'Sistem', ]) ->databaseNotifications() ->databaseNotificationsPolling('30s') diff --git a/composer.json b/composer.json index e5fbe36..ff3dff1 100644 --- a/composer.json +++ b/composer.json @@ -10,6 +10,7 @@ "license": "MIT", "require": { "php": "^8.2", + "achyutn/filament-log-viewer": "^1.7", "asmit/filament-upload": "^1.1", "bezhansalleh/filament-shield": "^4.0", "bilfeldt/laravel-route-statistics": "^4.2", diff --git a/composer.lock b/composer.lock index 3f4c705..de39716 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,93 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "4f6cfc9fed7cb0e122dae7b27fc317b1", + "content-hash": "1e48d213e49952c66fddc54eeca3c7e6", "packages": [ + { + "name": "achyutn/filament-log-viewer", + "version": "v1.7.0", + "source": { + "type": "git", + "url": "https://github.com/achyutkneupane/filament-log-viewer.git", + "reference": "d133c4e533cd23dd259f4bd522c83b3bf0e735aa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/achyutkneupane/filament-log-viewer/zipball/d133c4e533cd23dd259f4bd522c83b3bf0e735aa", + "reference": "d133c4e533cd23dd259f4bd522c83b3bf0e735aa", + "shasum": "" + }, + "require": { + "filament/filament": "^4.0", + "phiki/phiki": "^2.0", + "php": ">=8.2" + }, + "require-dev": { + "larastan/larastan": "^3.0", + "laravel/pint": "^1.23", + "orchestra/testbench": "^10.4", + "pestphp/pest": "^3.8", + "pestphp/pest-plugin-laravel": "^3.2", + "pestphp/pest-plugin-livewire": "^3.0", + "phpstan/phpstan": "^2.1", + "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.7.0" + }, + "funding": [ + { + "url": "https://www.buymeacoffee.com/achyutn", + "type": "buy_me_a_coffee" + }, + { + "url": "https://buymemomo.com/achyut", + "type": "custom" + }, + { + "url": "https://github.com/achyutkneupane", + "type": "github" + }, + { + "url": "https://www.patreon.com/Achyut", + "type": "patreon" + } + ], + "time": "2026-01-17T12:13:44+00:00" + }, { "name": "anourvalar/eloquent-serialize", "version": "1.3.5", @@ -5358,6 +5443,77 @@ }, "time": "2025-09-24T15:06:41+00:00" }, + { + "name": "phiki/phiki", + "version": "v2.1.0", + "source": { + "type": "git", + "url": "https://github.com/phikiphp/phiki.git", + "reference": "b16020573e9f4ad3c9d230c17ed4c84c15356e28" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phikiphp/phiki/zipball/b16020573e9f4ad3c9d230c17ed4c84c15356e28", + "reference": "b16020573e9f4ad3c9d230c17ed4c84c15356e28", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "league/commonmark": "^2.5.3", + "php": "^8.2", + "psr/simple-cache": "^3.0" + }, + "require-dev": { + "illuminate/support": "^11.45", + "laravel/pint": "^1.18.1", + "orchestra/testbench": "^9.15", + "pestphp/pest": "^3.5.1", + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan": "^2.0", + "symfony/var-dumper": "^7.1.6" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Phiki\\Adapters\\Laravel\\PhikiServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Phiki\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ryan Chandler", + "email": "support@ryangjchandler.co.uk", + "homepage": "https://ryangjchandler.co.uk", + "role": "Developer" + } + ], + "description": "Syntax highlighting using TextMate grammars in PHP.", + "support": { + "issues": "https://github.com/phikiphp/phiki/issues", + "source": "https://github.com/phikiphp/phiki/tree/v2.1.0" + }, + "funding": [ + { + "url": "https://github.com/sponsors/ryangjchandler", + "type": "github" + }, + { + "url": "https://buymeacoffee.com/ryangjchandler", + "type": "other" + } + ], + "time": "2026-01-20T21:26:48+00:00" + }, { "name": "phpdocumentor/reflection-common", "version": "2.2.0", diff --git a/database/seeders/ShieldSeeder.php b/database/seeders/ShieldSeeder.php index e5fcd80..e57d6d4 100644 --- a/database/seeders/ShieldSeeder.php +++ b/database/seeders/ShieldSeeder.php @@ -136,6 +136,8 @@ public function run(): void "View:JournalistRegistrationChart", + "View:LogTable", + "ViewAny:Location", "View:Location", "Create:Location",