Laravel Community Tools by Tighten
Laravel Nova icon Nova Packages
L

Log Level Field

Readme

Nova Log Level Field

Packagist Downloads

Laravel Nova field to display an log level badge on index and detail views of models. Tiny single file package.

See the screenshots here.

Features

  • Follows the PSR-3: Logger Interface log levels
  • Big or small badge layout
  • Customizable badge colors
  • Super tiny, neither css, nor js files

Install from

composer require dotburo/nova-log-level-field

(For Nova 3.0, install dotburo/nova-log-level-field:^1.2 instead.)

Usage

The package expects the value of the field to be one of PSR-3 log level: emergency, alert, critical, error, warning, notice, info or debug.

// for example, in app/Nova/Post.php

use Dotburo\NovaLogLevel\LogLevelField;
use Psr\Log\LogLevel;

// ...

public function fields(Request $request) {
    return [
        LogLevelField::make('Level')
            // Optional, show a small badge
            ->small()
            // Optional, override one or more default colors
            ->colors([
                LogLevel::EMERGENCY => '#000000',
            ]),
    ];
}

License

The MIT License (MIT). Please see the license file for more information.

Screenshots

Back to Top
Added 4 years ago
Last updated 2 Years Ago
Version 2.1.1
Composer
dotburo/nova-log-level-field
GitHub stars 1
Packagist downloads 60

Favorites

0 users favorited

Rating

N/A
(out of 5)
★★★★★
★★★★
★★★
★★
0 ratings

Tags

Brought to you by Tighten

Issues/Feature Requests Stats Package Ideas