Description
A ledger-based Laravel package for managing credit-based systems in your application.
🔧 Setup Your Model
Add the HasCredits trait to any model that should handle credits:
use Climactic\Credits\Traits\HasCredits; class User extends Model{ use HasCredits;}
💳 Basic Usage
// Add credits$user->creditAdd(100.00, 'Subscription Activated'); // Deduct credits$user->creditDeduct(50.00, 'Purchase Made'); // Get current balance$balance = $user->creditBalance(); // Check if user has enough creditsif ($user->hasCredits(30.00)) { // Proceed with transaction}
💸 Transfers
Transfer credits between two models:
$sender->creditTransfer($recipient, 100.00, 'Paying to user for their service');
Recent Courses on Laravel Daily
[NEW] Laravel Boost: Deeper Practical Dive
8 lessons
32 min
Practical Laravel Security: Packages, Secrets, Supply-Chain Attacks
7 lessons
43 min read
Testing in Laravel 13 For Beginners
26 lessons
1 h 41 min read