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
Testing in Laravel 13 For Beginners
26 lessons
1 h 41 min read
Queues in Laravel 13
18 lessons
1 h 12 min read
How to Structure Laravel 13 Projects
16 lessons
1 h 32 min read