PHPackages                             marshmallow/resource-progress - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. marshmallow/resource-progress

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

marshmallow/resource-progress
=============================

A Laravel Nova field.

1.0.0(1y ago)0374MITPHPPHP ^8.3

Since Aug 7Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/marshmallow-packages/nova-resource-progress)[ Packagist](https://packagist.org/packages/marshmallow/resource-progress)[ RSS](/packages/marshmallow-resource-progress/feed)WikiDiscussions main Synced 4w ago

READMEChangelog (1)Dependencies (2)Versions (3)Used By (0)

[![alt text](https://camo.githubusercontent.com/f5450f299f5713ce2f04dd5a1ba7ce9960ed4568b3574e4c4ee3cddc75477253/68747470733a2f2f6d617273686d616c6c6f772e6465762f63646e2f6d656469612f6c6f676f2d7265642d3233377834362e706e67 "marshmallow.")](https://camo.githubusercontent.com/f5450f299f5713ce2f04dd5a1ba7ce9960ed4568b3574e4c4ee3cddc75477253/68747470733a2f2f6d617273686d616c6c6f772e6465762f63646e2f6d656469612f6c6f676f2d7265642d3233377834362e706e67)

Nova Resource Progress
======================

[](#nova-resource-progress)

[![Latest Version on Packagist](https://camo.githubusercontent.com/bdd7ffe0d0e6ceb5fb8d5b1eb5ff51db9a9eac661a7a1d145f7eb6c4011cfdee/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d617273686d616c6c6f772f7265736f757263652d70726f67726573732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/marshmallow/resource-progress)[![Total Downloads](https://camo.githubusercontent.com/165e9564b4b1357f271c764674e76784e3a06e7faeaeb973f18f52b0f1270816/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d617273686d616c6c6f772f7265736f757263652d70726f67726573732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/marshmallow/resource-progress)

A Laravel Nova field that visualises how "complete" a resource is. You define one or more *suites* of *actions* (checks) on your model, and the field renders a progress indicator per suite based on how many of those checks pass. Progress is recalculated automatically whenever a tracked model is created, updated or restored, and can be recalculated in bulk from Nova index actions.

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

[](#installation)

Install the package via Composer:

```
composer require marshmallow/resource-progress
```

The package is auto-discovered through its `FieldServiceProvider`, so no manual provider registration is required.

Optionally publish the config file:

```
php artisan vendor:publish --provider="Marshmallow\ResourceProgress\FieldServiceProvider"
```

Configuration
-------------

[](#configuration)

The published `config/resource-progress.php` exposes the following options:

KeyDefaultDescription`progress``[\Marshmallow\ResourceProgress\Actions\FieldFilled::class]`The default actions run for the `progress` suite. Add config keys named after other suites to give them default actions too.`after_commit``false`When `true`, progress updates triggered by the model observer are dispatched after all database transactions have committed.Usage
-----

[](#usage)

### 1. Track a model

[](#1-track-a-model)

Add the `TrackResourceProgress` trait to any Eloquent model you want to track, and declare one or more suites with the `ResourceProgressSuite` attribute. The attribute is repeatable, so a model can have several suites.

```
use Marshmallow\ResourceProgress\Traits\TrackResourceProgress;
use Marshmallow\ResourceProgress\Attributes\ResourceProgressSuite;

#[ResourceProgressSuite(suite: 'progress', name: 'Progress')]
#[ResourceProgressSuite(suite: 'publish', name: 'Publish', fields: ['name', 'intro'])]
class Product extends Model
{
    use TrackResourceProgress;
}
```

The package registers a model observer for every model that uses the `TrackResourceProgress` trait. Progress is recalculated on `created`, `updated` and `restored` events and stored on the model's `resource_progress` attribute.

### 2. Define the checks for a suite

[](#2-define-the-checks-for-a-suite)

Each suite resolves its actions in this order:

1. The actions configured under `config('resource-progress.{suite}')`.
2. The actions returned by a `set{Suite}Actions()` method on the model.

So to add checks to the `publish` suite, add a `setPublishActions()` method:

```
use Marshmallow\ResourceProgress\Actions\FieldFilled;

public function setPublishActions(): array
{
    return [
        FieldFilled::class,
    ];
}
```

The built-in `FieldFilled` action checks that a list of fields is filled. It reads the fields from the suite's `fields` argument, or — if present — from a `get{Suite}RequiredFields()` method on the model:

```
public function getProgressRequiredFields(): array
{
    return ['name', 'intro', 'description', 'supplier_id', 'product_category_id'];
}
```

### 3. Add the field to your Nova resource

[](#3-add-the-field-to-your-nova-resource)

Add the field to your Nova resource's `fields()` method. It reads the suites declared on the underlying model automatically:

```
use Marshmallow\ResourceProgress\ResourceProgress;

ResourceProgress::make(__('Progress')),
```

The field has no editable value; it only displays progress. Its appearance can be tuned with the following fluent setters (defaults shown):

```
ResourceProgress::make(__('Progress'))
    ->setCircleSize(20)
    ->setStrokeWidth(3)
    ->setProgressBarHeight(15)
    ->setColorRanges([
        0 => '#ef4444',
        50 => '#facc15',
        100 => '#16a34a',
    ]);
```

`setColorRanges()` maps a percentage threshold to the colour used at or above it.

### 4. Recalculate progress in bulk (optional)

[](#4-recalculate-progress-in-bulk-optional)

Two Nova actions are provided to recalculate progress from the index:

```
use Marshmallow\ResourceProgress\Nova\Actions\IndexResourceProgress;
use Marshmallow\ResourceProgress\Nova\Actions\IndexResourcesProgress;

public function actions(NovaRequest $request): array
{
    return [
        // Recalculate the selected resources immediately.
        IndexResourceProgress::make(),

        // Recalculate every record of the resource on the queue.
        IndexResourcesProgress::make(self::class)->standalone(),
    ];
}
```

`IndexResourcesProgress` queues an `UpdateResourceProgressJob` per record, so it is suited to large tables.

### Writing your own checks

[](#writing-your-own-checks)

Generate a custom action or suite with the included Artisan commands:

```
php artisan make:resource-progress-action MissingTranslationsAction
php artisan make:resource-progress-suite SeoSuite
```

A custom action extends `ResourceProgressAction` and implements `handle()`. Call `incrementCheckCount()` for every check performed and `fail()` (with a message) for every check that does not pass:

```
use Marshmallow\ResourceProgress\Actions\ResourceProgressAction;
use Marshmallow\ResourceProgress\Contracts\ResourceProgressSuiteInterface;

class HasIntroAction extends ResourceProgressAction
{
    public function handle(ResourceProgressSuiteInterface $suite): void
    {
        $this->incrementCheckCount();

        if (! $this->resource->intro) {
            $this->fail(__('The intro is missing.'));
        }
    }
}
```

### Events

[](#events)

A `Marshmallow\ResourceProgress\Events\ProgressUpdated` event is dispatched each time a suite's progress is recalculated. It carries the `$model`, the `$suite` and the full `$current_progress` array, so you can listen for it to react to progress changes.

Credits
-------

[](#credits)

- [Marshmallow](https://github.com/marshmallow-packages)
- [All Contributors](https://github.com/marshmallow-packages/nova-resource-progress/contributors)

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please report security vulnerabilities by email to  rather than via the public issue tracker.

License
-------

[](#license)

The MIT License (MIT). Please see the [License File](LICENSE.md) for more information.

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance72

Regular maintenance activity

Popularity14

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 90% 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

Unknown

Total

1

Last Release

366d ago

### Community

Maintainers

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

---

Top Contributors

[![stefvanesch](https://avatars.githubusercontent.com/u/46725619?v=4)](https://github.com/stefvanesch "stefvanesch (9 commits)")[![LTKort](https://avatars.githubusercontent.com/u/2412670?v=4)](https://github.com/LTKort "LTKort (1 commits)")

---

Tags

laravelnova

### Embed Badge

![Health badge](/badges/marshmallow-resource-progress/health.svg)

```
[![Health](https://phpackages.com/badges/marshmallow-resource-progress/health.svg)](https://phpackages.com/packages/marshmallow-resource-progress)
```

###  Alternatives

[optimistdigital/nova-multiselect-field

A multiple select field for Laravel Nova.

3443.7M8](/packages/optimistdigital-nova-multiselect-field)[inspheric/nova-defaultable

Default values for Nova fields when creating resources and running resource actions.

51182.1k1](/packages/inspheric-nova-defaultable)[murdercode/nova4-tinymce-editor

Boost your Laravel Nova with the TinyMCE editor.

17194.8k1](/packages/murdercode-nova4-tinymce-editor)[datomatic/nova-detached-actions

A Laravel Nova tool to allow for placing actions in the Nova toolbar detached from the checkbox selection mechanism.

12287.4k](/packages/datomatic-nova-detached-actions)[wemersonrv/input-mask

A Laravel Nova custom field text with masks on input

1199.1k](/packages/wemersonrv-input-mask)

PHPackages © 2026

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