Code Monkey home page Code Monkey logo

overlook's Introduction

Overlook for Filament

Latest Version on Packagist Total Downloads

A Filament plugin that adds an app overview widget to your admin panel.

overlook-og

Installation

You can install the package via composer:

composer require awcodes/overlook

Then add the widget to your dashboard class or the Filament config file.

'widgets' => [
    'namespace' => 'App\\Filament\\Widgets',
    'path' => app_path('Filament/Widgets'),
    'register' => [
        \Awcodes\Overlook\Overlook::class,
        ...
    ],
],

Configuration

By default, Overlook will display any resource registered with Filament, while still honoring the canViewAny policy. This can be undesired and also slow down the dashboard. To prevent this behavior publish the config file with:

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

Inside the config you will have options to either "include" or "exclude" resources from being displayed. These are not meant to work together, you should use one of the other.

You can also choose to convert the count to a human-readable format. For example, 1000 will be converted to 1k. This is the default behavior.

Converted counts will also have a tooltip that displays the full count. This can be disabled by setting enable_convert_tooltip to false.

return [
    'includes' => [
        App\Filament\Resources\Blog\AuthorResource::class,
        App\Filament\Resources\Blog\CategoryResource::class,
        App\Filament\Resources\Blog\PostResource::class,
    ],
    'excludes' => [
//        App\Filament\Resources\Blog\AuthorResource::class,
    ],
    'should_convert_count' => true,
    'enable_convert_tooltip' => true,
];

Reordering & Polling

Should you need to reorder the location of the widget or want to enable polling, you can make your own version of the Overlook widget and register it instead.

namespace App\Filament\Widgets;

use Awcodes\Overlook\Overlook;

class CustomOverlookWidget extends Overlook
{
    protected static ?int $sort = 10;

    protected static ?string $pollingInterval = '10s';
}

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.

overlook's People

Contributors

awcodes avatar dependabot[bot] avatar github-actions[bot] avatar hassanzahirnia avatar maaz1n avatar saifallak avatar

Watchers

 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.