cashier package, meaning it integrates seamlessly with Laravel’s existing billing infrastructure (e.g., Billable trait, Subscription model, and Invoice handling). This reduces architectural complexity by reusing Laravel’s proven patterns.webong-cashier.subscription.created, invoice.paid), enabling integration with queues, notifications, and third-party services.laravel/cashier. Replaces Paystack-specific logic with this package’s methods (e.g., createSubscription() instead of raw Paystack SDK calls).paystack/paystack-php, so existing Paystack integrations (e.g., webhooks) may need updates to align with this package’s event system.webong-cashier, migration effort is moderate (API differences may require refactoring).subscription:paid) instead of raw Paystack payloads.webong-cashier may need validation.laravel/cashier or webong-cashier?
laravel/cashier (required; conflicts if not installed).paystack/paystack-php (managed by this package).subscription:created).HttpTests, Mocks) for Paystack interactions.laravel/cashier (if not already present).composer require veeqtoh/cashier-paystack
php artisan vendor:publish --provider="Veeqtoh\CashierPaystack\CashierPaystackServiceProvider"
php artisan migrate
.env with Paystack SECRET_KEY and PUBLIC_KEY.config/cashier-paystack.php (e.g., webhook URL, default plan).Billable trait on user/models:
use Veeqtoh\CashierPaystack\Billable;
class User extends Authenticatable { use Billable; }
POST /paystack-webhook (route defined in the package).CashierPaystack::verifyWebhook().// Before (webong-cashier or raw SDK)
$subscription = Paystack::getClient()->createSubscription($plan);
// After
$user->newSubscription('main')->create($planId);
composer.json for exact ranges).webong-cashier or raw SDK may need porting.paystack/paystack-php if needed.updateSubscriptions()) may hit Paystack rate limits; implement retries with exponential backoff.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Paystack API downtime | No new subscriptions/payments | Implement retry logic with dead-letter queues for failed jobs. |
| Webhook delivery failures | Stale subscription states | Use Paystack’s retry webhooks and log undelivered events. |
| Currency/multi-business gaps | Limited functionality | Extend the package or use raw SDK for unsupported features. |
| Laravel queue backlog | Delayed event processing | Scale queue workers; monitor failed_jobs table. |
| Package abandonment | No future updates | Fork the repo or migrate to paystack/paystack-php directly. |
How can I help you explore Laravel packages today?