PHPackages                             creagia/nova-percentage-card - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. creagia/nova-percentage-card

AbandonedArchivedLibrary

creagia/nova-percentage-card
============================

A Percentage Card for Nova apps

2.1.0(5y ago)55.9k1MITPHPPHP &gt;=7.1.0

Since Dec 1Pushed 1y ago2 watchersCompare

[ Source](https://github.com/creagia/nova-percentage-card)[ Packagist](https://packagist.org/packages/creagia/nova-percentage-card)[ Docs](https://github.com/creagia/nova-percentage-card)[ RSS](/packages/creagia-nova-percentage-card/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (4)Dependencies (1)Versions (5)Used By (0)

Nova Percentage Card
====================

[](#nova-percentage-card)

A Laravel Nova card to display percentages

[![alt text](screenshot.png)](screenshot.png)

Requirements
------------

[](#requirements)

- `php: >=7.1`
- `laravel/nova: ^2.0|^3.0`

Installation
------------

[](#installation)

```
composer require creagia/nova-percentage-card
```

Localization
------------

[](#localization)

Publish the package language files to your application's `resources/lang/vendor` directory:

```
php artisan vendor:publish --provider="Creagia\NovaPercentageCard\CardServiceProvider"

```

Usage:
------

[](#usage)

- Create a Class extending `\Creagia\NovaPercentageCard\NovaPercentageCard`
- Add a new Object to the `cards()` method

### Basic example

[](#basic-example)

```
class SpentBudget extends \Creagia\NovaPercentageCard\NovaPercentageCard
{
    /**
     * Get the total of filtered records
     *
     * @return float
     */
    function getCount(): float
    {
        return Order::sum('total');
    }

    /**
     * Get the number of the total records
     *
     * @return float
     */
    function getTotal(): float
    {
        return config('app.total_budget');
    }
}
```

```
class NovaServiceProvider extends NovaApplicationServiceProvider

...

/**
 * Get the cards that should be displayed on the default Nova dashboard.
 *
 * @return array
 */
protected function cards()
{
    return [
        new SpentBudget,
    ];
}
```

### Full example

[](#full-example)

```
class SpentBudget extends \Creagia\NovaPercentageCard\NovaPercentageCard
{
    /**
     * The displayable name of the metric.
     *
     * @var string
     */
    protected $name = 'Spent budget';

    /**
     * The label for the total entries.
     *
     * @var string|null
     */
    protected $label = '€';

    /**
     * The number of decimal points
     *
     * @var int
     */
    protected $percentagePrecision = 2;

    /**
     * The width of the card (1/3, 1/2, or full).
     *
     * @var string
     */
    public $width = '1/3';

    /**
     * Get the total of filtered records
     *
     * @return float
     */
    function getCount(): float
    {
        return Order::sum('total');
    }

    /**
     * Get the number of the total records
     *
     * @return float
     */
    function getTotal(): float
    {
        return config('app.total_budget');
    }

    /**
     * Determine for how many time the metric should be cached.
     *
     * @return  \DateTimeInterface|\DateInterval|float|int
     */
    public function cacheFor(): int
    {
        return now()->addMinutes(5);
    }

    /**
     * Determine the cache key
     *
     * @return  string
     */
    public function cacheKey(): string
    {
        return 'spent-budget-percentage-card';
    }
}
```

### Resource Detail example

[](#resource-detail-example)

```
class OrderTotalPaid extends \Creagia\NovaPercentageCard\NovaPercentageCard
{
    function getCount(): float
    {
        return \App\Models\Order::find($this->getResourceId())->total_paid;
    }

    function getTotal(): float
    {
        return \App\Models\Order::find($this->getResourceId())->total;
    }
}

...

public function cards(Request $request)
{
    $percentageCard = new OrderTotalPaid();
    $percentageCard->setResourceId($request->resourceId ?? null);
    return [
        $percentageCard->onlyOnDetail(),
    ];
}
```

License
-------

[](#license)

This project is licensed under the MIT License - see the [MIT license](LICENSE.md) file for details

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance33

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~20 days

Total

4

Last Release

1927d ago

Major Versions

1.0.1 → 2.0.02020-12-29

### Community

Maintainers

![](https://www.gravatar.com/avatar/eb8d6e5cd2001939a7ab04426d1c21068da6cb9925a6a26aa5aca5b9a1338afa?d=identicon)[creagia](/maintainers/creagia)

---

Top Contributors

[![dtorras](https://avatars.githubusercontent.com/u/240932?v=4)](https://github.com/dtorras "dtorras (5 commits)")[![xmuntane](https://avatars.githubusercontent.com/u/4507708?v=4)](https://github.com/xmuntane "xmuntane (5 commits)")

---

Tags

laravelnova

### Embed Badge

![Health badge](/badges/creagia-nova-percentage-card/health.svg)

```
[![Health](https://phpackages.com/badges/creagia-nova-percentage-card/health.svg)](https://phpackages.com/packages/creagia-nova-percentage-card)
```

###  Alternatives

[optimistdigital/nova-sortable

This Laravel Nova package allows you to reorder models in a Nova resource's index view using drag &amp; drop.

2872.1M6](/packages/optimistdigital-nova-sortable)[outl1ne/nova-sortable

This Laravel Nova package allows you to reorder models in a Nova resource's index view using drag &amp; drop.

2861.8M9](/packages/outl1ne-nova-sortable)[laravel/nova-log-viewer

A Laravel Nova tool for viewing your application logs.

136301.3k1](/packages/laravel-nova-log-viewer)[stepanenko3/nova-command-runner

Laravel Nova tool for running Artisan and bash(shell) commands.

36983.0k](/packages/stepanenko3-nova-command-runner)[sbine/route-viewer

A Laravel Nova tool to view your registered routes.

57215.9k](/packages/sbine-route-viewer)[dniccum/nova-documentation

A Laravel Nova tool that allows you to add markdown-based documentation to your administrator's dashboard.

37116.4k](/packages/dniccum-nova-documentation)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
