New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

fidum/laravel-nova-metrics-polling

Easily add polling to all your Laravel Nova metrics and cards!
14,475 6
Install
composer require fidum/laravel-nova-metrics-polling
Latest Version:1.0.5
PHP:^8.1
Laravel:11 · 12 · 13
Older releases:10
License:MIT
Last Updated:Jul 20, 2026
Links: GitHub  ·  Packagist
Maintainer: dmason30

Easily add polling to all your Laravel Nova metrics and cards!

Latest Version on Packagist GitHub Workflow Status (with branch) Twitter Follow

Easily add polling to all your Laravel Nova metrics and cards!

Installation

You can install the package via composer:

composer require fidum/laravel-nova-metrics-polling

Usage

Firstly, just add the SupportsPolling trait to any of your Metrics or Card classes:

<?php

namespace App\Nova\Metrics;

use Fidum\LaravelNovaMetricsPolling\Concerns\SupportsPolling;

class NewUsers extends Value
{
    use SupportsPolling;

Then in the Dashboard, Resource or Lens cards method where you have registered your card you can call refreshIntervalSeconds and pass in the number of seconds you want the interval to be between refresh requests. You can also pass a closure as needed.

use App\Nova\Metrics\NewUsers;
use App\Nova\Metrics\NewOrders;

public function cards(NovaRequest $request)
{
    return [
        NewUsers::make()->refreshIntervalSeconds(30),
        NewOrders::make()->refreshIntervalSeconds(fn () => 30),
    ];
}

If preferred, you can call refreshIntervalMilliseconds instead and pass in the number of milliseconds you want the interval to be between refresh requests.

use App\Nova\Metrics\NewUsers;
use App\Nova\Metrics\NewOrders;

public function cards(NovaRequest $request)
{
    return [
        NewUsers::make()->refreshIntervalMilliseconds(30000),
        NewOrders::make()->refreshIntervalMilliseconds(fn () => 30000),
    ];
}

That is it, your cards should now be polling at the specified intervals! :tada:

Testing

composer test

Changelog

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

Contributing

Please see CONTRIBUTING for details.

Credits

License

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

Related Packages

laravel/nova-pennant

A Pennant Resource Tool for Laravel Nova

248,414 24
chinleung/laravel-nova-optimizer

A package to optimize performance of Laravel Nova classes.

23,193 1
adtention/nova-datepicker-filter

A Laravel Nova date field built as a thin wrapper around vuepic/vue-datepicker.

3,851 1
maatwebsite/laravel-nova-excel

Supercharged Excel exports for Laravel Nova Resources

7,226,927 401
pekhota/nova-scroll-buttons

Laravel Nova package providing global floating scroll-to-top and scroll-to-botto...

5,989 0

Version History

Version Released PHP Laravel License
1.0.5 ^8.1 ^11.0|^12.0|^13.0 MIT
1.0.4 ^8.1 ^10.0|^11.0|^12.0 MIT
1.0.3 ^8.1 ^10.0|^11.0 MIT
1.0.2 ^8.1 ^10.0|^11.0 MIT
1.0.1 ^8.1 ^10.0 MIT