Bandwagon is a Social Proof Package for Laravel

Packages

January 5th, 2021

laravel-bandwagon-featured.png

Laravel Bandwagon is a package to help promote social proof and legitimacy within your application. You can let users of your application know when others’ share, purchase, subscribe, or donate, for example:

Using blade and Vue, here’s how easy it is to feed data into the social proof component, which is then displayed in the user’s browser via polling:

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()
    );
}

In your blade template (i.e., on your product page), you render the widget by using the provided blade component:

<x-bandwagon-renderer />

The package allows you to configure things like poll increments (how often to check for new events), how long to display events, and the age of valid events.

Bandwagon’s documentation is available on www.laravelbandwagon.com, and you can learn more about this package’s source code on GitHub.

Filed in:

Paul Redmond

Full stack web developer. Author of Lumen Programming Guide and Docker for PHP Developers.