Skip to content

A Laravel package to quickly integrate with Kanuu

License

Notifications You must be signed in to change notification settings

kanuu-io/kanuu-laravel

Repository files navigation

Integrate Kanuu to your Laravel application

Latest Version on Packagist GitHub Tests Action Status Total Downloads

🛶 Quickly integrate your Laravel application with Kanuu in 3 simple steps.

Installation

composer require kanuu-io/kanuu-laravel

Documentation

📚 Read the full documentation at docs.kanuu.io

Basic usage

1. Add your Kanuu API key to your .env file.
KANUU_API_KEY="YOUR_API_KEY"

2. Add a route to your routes/web.php that will redirect your user to Kanuu based on a unique identifier.

use Kanuu\Laravel\Facades\Kanuu;

// ...

Kanuu::redirectRoute()->name('kanuu.redirect');

3. Add a "Manage your subscription" button that uses that route.

<a href="{{ route('kanuu.redirect', $user) }}" class="...">
    Manage your subscription
</a>

Note that your can use any identifier you want as long as it's unique throughout your application. For example, if you want to provide team-based subscription, you can use route('kanuu.redirect', $team) or route('kanuu.redirect', $team->uuid).

And that's it! ✨

Advanced usage

Kanuu's package provide a lot more for you to get started using Kanuu and Paddle. This includes:

Full documentation available at docs.kanuu.io

License

The MIT License (MIT). Please see License File for more information.