kanuu-io/kanuu-laravel

Integrate Kanuu to your Laravel application

v1.0.0 2022-11-19 18:27 UTC

This package is auto-updated.

Last update: 2024-11-19 23:10:39 UTC


README

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.