PHPackages                             alboradait/laravel-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. alboradait/laravel-progress

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

alboradait/laravel-progress
===========================

Progress tracking tools for Laravel

v1.0.1(1y ago)022MITPHP

Since Mar 24Pushed 1y agoCompare

[ Source](https://github.com/AlboradaIT/laravel-progress)[ Packagist](https://packagist.org/packages/alboradait/laravel-progress)[ RSS](/packages/alboradait-laravel-progress/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

Add progress tracking to your eloquent models
=============================================

[](#add-progress-tracking-to-your-eloquent-models)

This package allows you to easily track user progress through any kind of progressable resource: courses, tutorials, onboarding flows, or any custom process with defined steps.

---

Features
--------

[](#features)

- Easily track progress for Eloquent models implementing `Progressable`
- Built-in trait `TracksProgress` with sensible defaults
- Progress-related events:
    - `ProgressStarted`
    - `ProgressUpdated`
    - `ProgressCompleted`
    - `ProgressAbandoned`
    - `ProgressRestarted`
- Automatic recalculation on demand
- Weighted step support
- Blade components for displaying progress
- Configuration-driven
- Test-covered and queue-ready
- In development: Progress Reports

---

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

[](#installation)

```
composer require alboradait/laravel-progress
```

If you're using Laravel 11+, package auto-discovery is enabled.

To publish the config file:

```
php artisan vendor:publish --tag=progress-config
```

To publish views (Blade components):

```
php artisan vendor:publish --tag=progress-views
```

---

Usage
-----

[](#usage)

### 1. Implement the `Progressable` Interface

[](#1-implement-the-progressable-interface)

```
use AlboradaIT\LaravelProgress\Contracts\Progressable;
use AlboradaIT\LaravelProgress\Support\Traits\TracksProgress;

class Course extends Model implements Progressable
{
    use TracksProgress;

    // Define the steps of a progress
    public function definedSteps(): array
    {
        return $this->learningUnits;
    }

    public function getCompletedSteps(User $user): array
    {
        return $user->completedLearningUnits;
    }
}
```

### 2. Update Progress

[](#2-update-progress)

```
$course->updateUserProgress($user);
```

This will update the `ProgressRecord`, and dispatch events if something changed.

### 3. Reset Progress

[](#3-reset-progress)

```
$course->resetProgress($user);
```

> 🔔 Note: Resetting the progress record only affects the internal `ProgressRecord` (percentage, status, etc). It **does not** remove any external state like `completedLearningUnits` — you're responsible for clearing that if needed.

### 4. Listen to Events

[](#4-listen-to-events)

All progress events are dispatched via Laravel's event system, so you can listen to them using listeners, jobs, or observers.

---

Events
------

[](#events)

EventDescription`ProgressStarted`Fired when a new progress starts`ProgressUpdated`Fired when percentage changes`ProgressCompleted`Fired when 100% progress is reached`ProgressAbandoned`Fired when no progress after a time threshold`ProgressRestarted`Fired when progress is manually reset---

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

[](#configuration)

After publishing the config file, you'll find `config/progress.php`:

```
return [
    'queue_connection' => env('PROGRESS_QUEUE_CONNECTION', 'sync'),
    'queue_name' => env('PROGRESS_QUEUE', 'default'),
    'abandon_after' => 3600 * 24 * 30, // 30 days (in seconds)
];
```

---

Advanced Features
-----------------

[](#advanced-features)

### Weighted Steps

[](#weighted-steps)

Define steps with metadata (e.g., duration):

```
public function definedSteps(): array {
    return [
        ['name' => 'intro', 'duration' => 300],
        ['name' => 'chapter_1', 'duration' => 1200],
        ['name' => 'chapter_2', 'duration' => 600],
    ];
}

public function getWeightForStep(mixed $step): int {
    return $step['duration'] ?? 1;
}
```

### Recalculating Progresses

[](#recalculating-progresses)

Trigger mass recalculations by dispatching events that implement the `ShouldTriggerProgressRecalculation` interface:

```
use AlboradaIT\LaravelProgress\Contracts\ShouldTriggerProgressRecalculation;

class LearningUnitDeleted implements ShouldTriggerProgressRecalculation
{
    public function __construct(public Course $course) {}

    public function getProgressables(): array
    {
        return [$this->course];
    }
}
```

> 📝 You can return **multiple progressables** from `getProgressables()`. All of them will be recalculated.

---

Queue Behavior
--------------

[](#queue-behavior)

- `updateUserProgress($user)` runs **immediately**. It's designed for real-time UI updates or per-user actions.
- Events triggered by implementing `ShouldTriggerProgressRecalculation` are **queued** and processed asynchronously. This allows recalculating hundreds or thousands of progresses efficiently.

To change the queue connection or name, edit `config/progress.php`.

If you use `queue_connection = sync`, listeners will be run immediately.

---

Blade Components
----------------

[](#blade-components)

This package includes a couple of Blade components:

```

```

You can publish and customize the views:

```
php artisan vendor:publish --tag=progress-views
```

---

Testing
-------

[](#testing)

This package is covered with a comprehensive test suite. To run tests:

```
vendor/bin/phpunit
```

> Uses Orchestra Testbench for package testing.

---

License
-------

[](#license)

MIT License. Copyright (c) Alborada IT.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance51

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

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

2

Last Release

391d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4f0bb6076db63b006d00585bddc443e90f35ec5d74d0af2ae6f11ac74d0f27ae?d=identicon)[sergioalborada](/maintainers/sergioalborada)

---

Top Contributors

[![sergioalborada](https://avatars.githubusercontent.com/u/129586554?v=4)](https://github.com/sergioalborada "sergioalborada (12 commits)")

### Embed Badge

![Health badge](/badges/alboradait-laravel-progress/health.svg)

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

PHPackages © 2026

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