manzadey/laravel-orchid-storage-logs

Package for Laravel Admin Panel Orchid. Allows you to view laravel logs in the Orchid admin panel.

v1.0.2 2023-03-22 11:04 UTC

This package is auto-updated.

Last update: 2024-04-22 13:27:10 UTC


README

Latest Version on Packagist Total Downloads PHPUnit Tests

This package allows you to view logs directly in the Laravel Orchid admin panel.

List of logs

Screenshot List Logs

Show Log

Screenshot Show Log

Features:

  • Download logs
  • Views logs
  • Delete logs
  • Sorting logs by name, date, size
  • Filtering logs by name
  • Sorting log messages by date, environment, type
  • Filtering log messages by environment, type, message

Installation

You can install the package via composer:

composer require manzadey/laravel-orchid-storage-logs

Usage

Optional publish config:

php artisan vendor:publish --tag=storage-logs-config

Publish routes:

php artisan vendor:publish --tag=storage-logs-routes

Or add yourself to the file platform.php

use Illuminate\Support\Facades\Route;
use Manzadey\LaravelOrchidStorageLogs\Screens as StorageLogScreens;
use Tabuna\Breadcrumbs\Trail;

Route::name('platform.storage-logs.')
    ->prefix('storage-logs')
    ->group(static function() {
        Route::screen('', StorageLogScreens\StorageLogListScreen::class)
            ->name('list')
            ->breadcrumbs(static fn(Trail $trail) : Trail => $trail
                ->parent('platform.index')
                ->push(__('Storage Logs'), route('platform.storage-logs.list'))
            );

        Route::screen('{storageLog}', StorageLogScreens\StorageLogShowScreen::class)
            ->name('show')
            ->breadcrumbs(static fn(Trail $trail, string $storageLog) : Trail => $trail
                ->parent('platform.storage-logs.list')
                ->push($storageLog, route('platform.storage-logs.show', $storageLog))
            );
    });

Add a menu item to the method registerMainMenu() in the PlatformProvider to access logs:

use Manzadey\LaravelOrchidStorageLogs\Screen\Actions\StorageLogsMenu;

class PlatformProvider extends OrchidServiceProvider
{
    /**
     * @return Menu[]
     */
    public function registerMainMenu(): array
    {
        return [
            // Menu items
            
            StorageLogsMenu::make()
                ->route('platform.storage-logs.list'),
        ];
    }
}

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email andrey.manzadey@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.