PHPackages                             multek/laravel-nps - 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. multek/laravel-nps

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

multek/laravel-nps
==================

A simple, focused NPS (Net Promoter Score) package for Laravel applications.

v1.0.0(3mo ago)00MITPHPPHP ^8.2

Since Apr 1Pushed 3mo agoCompare

[ Source](https://github.com/Multek-Company/laravel-nps)[ Packagist](https://packagist.org/packages/multek/laravel-nps)[ RSS](/packages/multek-laravel-nps/feed)WikiDiscussions main Synced 4w ago

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

Laravel NPS
===========

[](#laravel-nps)

A simple, focused NPS (Net Promoter Score) package for Laravel applications. Collect user feedback on a 0-10 scale with survey campaigns, cooldown logic, and dismissal tracking.

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

[](#installation)

```
composer require multek/laravel-nps
```

Publish the config and migrations:

```
php artisan vendor:publish --tag=nps-config
php artisan vendor:publish --tag=nps-migrations
php artisan migrate
```

Setup
-----

[](#setup)

Add the `HasNpsResponses` trait to your User model:

```
use Multek\Nps\Traits\HasNpsResponses;

class User extends Authenticatable
{
    use HasNpsResponses;
}
```

Usage
-----

[](#usage)

### Creating a Survey

[](#creating-a-survey)

```
use Multek\Nps\Models\NpsSurvey;

$survey = NpsSurvey::create([
    'name' => 'Q1 2026',
    'description' => 'Quarterly NPS survey',
    'is_active' => true,
]);
```

### Checking Eligibility

[](#checking-eligibility)

```
$user->canAnswerNps(); // checks cooldown, dismissals, eligibility
$user->canAnswerNps($survey); // for a specific survey
```

### Recording Responses

[](#recording-responses)

```
$response = $user->answerNps($survey, 9, 'Great service!', ['source' => 'web']);
```

### Dismissals

[](#dismissals)

```
$user->dismissNps($survey); // records dismissal with attempt tracking
```

### Using the Facade

[](#using-the-facade)

```
use Multek\Nps\Facades\Nps;

Nps::currentSurvey();           // active survey or null
Nps::forUser($user);            // survey data if eligible, null otherwise
Nps::respond($surveyId, 9);     // record response for auth user
Nps::score($survey);            // NPS score (-100 to 100)
Nps::stats($survey);            // {score, total, promoters, passives, detractors}
```

### Inertia Integration

[](#inertia-integration)

Share NPS data via your `HandleInertiaRequests` middleware:

```
public function share(Request $request): array
{
    return [
        ...parent::share($request),
        'nps' => fn () => \Multek\Nps\Facades\Nps::forUser($request->user()),
    ];
}
```

In your React component:

```
const { nps } = usePage().props;
if (nps) {
    // Show NPS modal with nps.survey_id, nps.name, nps.description
}
```

### API Routes

[](#api-routes)

Routes are disabled by default. Enable them in `config/nps.php`:

```
'routes_enabled' => true,
```

MethodURIDescriptionGET`/api/nps/current`Get active survey for auth userPOST`/api/nps/{survey}/respond`Submit responsePOST`/api/nps/{survey}/dismiss`Record dismissal### Events

[](#events)

EventWhen`NpsResponseSubmitted`User submits a response`NpsSurveyDismissed`User dismisses the NPS prompt`NpsSurveyCompleted`Survey reaches end date (dispatch manually)```
use Multek\Nps\Events\NpsResponseSubmitted;

Event::listen(NpsResponseSubmitted::class, function ($event) {
    if ($event->response->is_detractor) {
        // Alert customer success team
    }
});
```

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

[](#configuration)

See `config/nps.php` for all options including:

- `cooldown_days` — days between surveys (default: 90)
- `max_attempts` — max times to show after dismissals (default: 3)
- `attempt_intervals` — days between re-shows (default: \[3, 7\])
- `eligibility_check` — custom closure for additional eligibility logic

License
-------

[](#license)

MIT

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance82

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

90d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8976719?v=4)[rodrigocoliveira](/maintainers/rodrigocoliveira)[@rodrigocoliveira](https://github.com/rodrigocoliveira)

---

Top Contributors

[![rodrigocoliveira](https://avatars.githubusercontent.com/u/8976719?v=4)](https://github.com/rodrigocoliveira "rodrigocoliveira (1 commits)")

---

Tags

laravelfeedbacksurveyNPSnet-promoter-score

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/multek-laravel-nps/health.svg)

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M337](/packages/psalm-plugin-laravel)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M125](/packages/laravel-pulse)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

77022.3M131](/packages/laravel-mcp)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M123](/packages/roots-acorn)[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.5k55.4M7.8k](/packages/larastan-larastan)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M169](/packages/laravel-ai)

PHPackages © 2026

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