bndwgn / laravel-bandwagon
Social proof package for Laravel
Fund package maintenance!
chasenyc
Installs: 7 171
Dependents: 0
Suggesters: 0
Security: 0
Stars: 113
Watchers: 5
Forks: 14
Open Issues: 2
pkg:composer/bndwgn/laravel-bandwagon
Requires
- php: ^7.4|^8.0
- illuminate/contracts: ^5.0|^6.0|^7.0|^8.0|^9.0
Requires (Dev)
- orchestra/testbench: ^6.0
- phpunit/phpunit: ^9.3
- vimeo/psalm: ^3.11
README
This is a Laravel package to help promote social proof and legitimacy within your application. With a simple blade component added to any page you can share with potential customers or users that other customers are using and/or paying for your product. A simple pop-up will display in the corner of page with information such as "Someone from New York purchased the business plan 2 minutes ago."
Full documentation can be found at laravelbandwagon.com
Getting Started
Installation
You can install this package via composer using:
composer require bndwgn/laravel-bandwagon
The package will automatically register its service provider.
To publish the config file to config/bandwagon.php run:
php artisan vendor:publish --provider="Bndwgn\Bandwagon\BandwagonServiceProvider"
Rendering the component
To render the component just add the component to any or all desired pages like so:
<x-bandwagon-renderer />
Publishing an event to users
To use the example of sharing a purchase with people who are on the purchase page of your application you would just add the following:
// App/Http/Controllers/PurchaseController.php use Bndwgn\Bandwagon\Bandwagon; public function purchase(Request $request, Product $product) { $user = Auth::user(); // ... logic to charge a customer Bandwagon::createEvent( "Someone from ${$user->state}", "Purchased the ${$product->displayName} plan", $request->ip(), route('purchase', $product->id) ); }
This will create a new Bandwagon record which then any users who are on the purchase page where you render the component (<x-bandwagon-renderer />) will see.
Credits
License
The MIT License (MIT). Please see License File for more information.
