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(4mo ago)00MITPHPPHP ^8.2

Since Apr 1Pushed 4mo 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 1w 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

34

—

LowBetter than 74% of packages

Maintenance75

Regular maintenance activity

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity49

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

137d 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

3345.4M354](/packages/psalm-plugin-laravel)[api-platform/laravel

API Platform support for Laravel

58190.1k21](/packages/api-platform-laravel)[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.6k31.8M160](/packages/laravel-cashier)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

79227.1M227](/packages/laravel-mcp)[fleetbase/core-api

Core Framework and Resources for Fleetbase API

1239.7k25](/packages/fleetbase-core-api)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5226.7k](/packages/simplestats-io-laravel-client)

PHPackages © 2026

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