Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Users Profile Balance

Users Profile Balance Laravel Package

baks-dev/users-profile-balance

BaksDev Profile Balance — пакет для управления балансом профилей пользователей. Установка через Composer, установка конфигурации и ресурсов командой baks:assets:install, поддержка миграций Doctrine и тестов PHPUnit. Требуется PHP 8.4+.

View on GitHub
Deep Wiki
Context7

At a glance

Frequently asked questions about Users Profile Balance
How do I install and configure this package in a Laravel project?
Run `composer require baks-dev/users-profile-balance`, then execute `php artisan baks:assets:install` to set up configurations. Add the package’s scripts to your `composer.json` under `post-install-cmd` and `post-update-cmd` for automated setup. Ensure your Laravel version is 10.x or 11.x and PHP is 8.4+.
Does this package support multiple balance types (e.g., points, credits) per user?
The package appears to focus on a monolithic balance system per profile, not multiple types. If you need separate balances (e.g., reputation_points and premium_credits), you’ll need to extend the package or implement a custom solution using its repository pattern.
How does the package handle concurrent balance updates to avoid race conditions?
The documentation doesn’t specify concurrency controls like transactions or optimistic locking. You should implement database transactions or use Laravel’s `lock()` method in your application logic to prevent race conditions when updating balances.
Can I use this package with Laravel 9.x or older PHP versions?
No, this package requires PHP 8.4+ and likely assumes Laravel 10.x/11.x features (e.g., attribute overrides). If you’re on Laravel 9.x, test thoroughly for compatibility issues, as some features may not work without adjustments.
Are there validation rules for balance limits (e.g., minimum/maximum values)?
The package doesn’t explicitly document configurable validation rules in the README. Check the source code or configuration files for defaults, or extend the package by overriding validation logic in your own service layer.
How do I run migrations if I already have a `profile_balances` table?
Run `php artisan doctrine:migrations:diff` to compare schemas, then `php artisan doctrine:migrations:migrate --dry-run` to preview changes. If conflicts exist (e.g., overlapping columns), resolve them manually or extend the migration. Always back up your database before running migrations in production.
Does this package support multi-tenancy for SaaS applications?
No, the package is designed for single-tenant or user-scoped balances. For multi-tenancy, you’ll need to extend the package or create a wrapper layer to scope balances by tenant ID, modifying the `profile_balances` table or adding a `tenant_id` column.
Are there events or hooks for triggering actions after balance updates?
The package likely supports Laravel Events (e.g., `BalanceUpdated`), but the README doesn’t detail them. Check the source code for event classes or extend the package by dispatching custom events in your application logic for side effects like notifications.
How do I test this package in my Laravel application?
Run `php artisan test --group=users-profile-balance` to execute the package’s built-in PHPUnit tests. For custom testing, mock the package’s services (e.g., `Balance`) using Laravel’s testing helpers and verify balance operations in isolated test cases.
What alternatives exist for managing user balances in Laravel?
Consider packages like `spatie/laravel-balance` (simpler, event-driven) or `laravel-billing/laravel-billing` (for subscriptions). For custom solutions, use Eloquent observers, model events, or Laravel’s policy/gate system to enforce balance rules without external dependencies.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
directorytree/privacy-filter-classifier
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata
splash/openapi