1. Go to this page and download the library: Download fullstack/redbird library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
fullstack / redbird example snippets
namespace App\Models;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Spatie\Permission\Traits\HasRoles;
class User extends Authenticatable
{
use HasRoles;
// ... your existing code
}
// Create a subscription
$user->newSubscription('default', 'price_123')->create();
// Check subscription status
if ($user->subscription('default')->active()) {
// User has active subscription
}
// Handle subscription changes
$user->subscription('default')->swap('price_456');