GithubHelp home page GithubHelp logo

flolanger / filament-laravel-log Goto Github PK

View Code? Open in Web Editor NEW

This project forked from saade/filament-laravel-log

0.0 0.0 0.0 981 KB

Access laravel.log file through Filament admin panel

License: MIT License

JavaScript 1.88% PHP 52.07% CSS 12.74% Blade 33.31%

filament-laravel-log's Introduction

Access laravel log through Filament admin panel

Log Viewer

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Features

  • Syntax highlighting
  • Quickly jump between start and end of the file
  • Refresh log contents
  • Clear log contents
  • Search multiple files in multiple directories New in v1.1.0
  • Ignore file patterns New in v1.1.0

Support Filament

filament-logo

Installation

You can install the package via composer:

composer require saade/filament-laravel-log

Usage

Just install the package and you're ready to go!

Configuration

You can publish the config file with:

php artisan vendor:publish --tag="log-config"

This is the contents of the published config file:

<?php

return [
    /**
     * Secure the page behind a custom policy.
     */
    'authorization' => false,

    /**
     * The directory(ies) containing the log files.
     */
    'logsDir' => [
        storage_path('logs'),
    ],

    /**
     * Files to ignore when searching for log files.
     * Accepts wildcards eg: *.log
     */
    'exclude' => [
        //
    ],

    /**
     * Navigation group.
     */
    'navigationGroup' => 'System',

    /**
     * Navigation sort.
     */
    'navigationSort' => 1,

    /**
     * Navigation icon.
     */
    'navigationIcon' => 'heroicon-o-document-text',

    /**
     * Navigation label.
     */
    'navigationLabel' => 'Logs',

    /**
     * Navigation slug.
     */
    'slug' => 'system-logs',

    /**
     * Maximum amount of lines that editor will render.
     */
    'maxLines' => 50,

    /**
     * Minimum amount of lines that editor will render.
     */
    'minLines' => 10,

    /**
     * Editor font size.
     */
    'fontSize' => 12
];

Authorization

If you would like to prevent certain users from accessing your page, you should enable authorization in config

// config/filament-laravel-log.php

<?php
return [
    /**
     * Secure the page behind a custom policy.
     */
    'authorization' => true,
];

and register an authorization callback inside of a ServiceProvider::boot() method.

// app/Providers/AppServiceProvider.php

<?php

public function boot()
{
    ViewLog::can(function (User $user) {
        return $user->role === Role::Admin;
    });
}

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

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

filament-laravel-log's People

Contributors

amiraghaee avatar dependabot[bot] avatar flolanger avatar github-actions[bot] avatar juliomotol avatar mileswucode avatar saade avatar ysfkaya avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.