quarterdeck / laravel-collection-nps
Laravel Collection Net Promoter Score Macro
Installs: 12
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/quarterdeck/laravel-collection-nps
Requires
- php: ^8.0
This package is not auto-updated.
Last update: 2025-12-22 21:48:14 UTC
README
Calculate Net Promoter Score (NPS) from a Collection.
Install
composer require quarterdeck/laravel-collection-nps
Use
Given a collection of numbers just add ->nps() and it will spit out an NPS score.
collect([1,2,3,4,5,6,7,8,9,0,10])->nps(); // -45
Any values not in the range of integers from 0-10 will be ignored.
collect([1,2,3,4,5,6,7,8,9,0,10,-1,99,null,false,'boo'])->nps(); // -45
License
License is public domain. Do what you wish. But if you fancy linking to us at quarterdeck.co.uk to help with our Google Juice as a thank you then it would be very much appreciated.
Be lucky.