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
Products Promotion

Products Promotion Laravel Package

baks-dev/products-promotion

Модуль акций на продукцию для PHP 8.4+/Laravel/Symfony: установка через Composer, команда baks:assets:install для ресурсов, миграции Doctrine для обновления БД, тесты PHPUnit (group=products-promotion).

View on GitHub
Deep Wiki
Context7

composer require baks-dev/products-promotion

Frequently asked questions about Products Promotion
Can I use this package with Laravel 10+ and PHP 8.4+ for a discount system?
Yes, this package is designed for Laravel 10+ and PHP 8.4+, making it suitable for building discount systems, bundles, or flash sales. Ensure your project meets these requirements before installation. The package integrates via Composer and includes Doctrine migrations for database setup.
How do I install and configure the package in my Laravel project?
Run `composer require baks-dev/products-promotion` to install. Then execute `php bin/console baks:assets:install` for asset setup and `php bin/console doctrine:migrations:diff` followed by `php bin/console doctrine:migrations:migrate` to update your database schema. Configuration files are automatically generated during installation.
Does this package work with Eloquent ORM, or is Doctrine required?
This package relies on Doctrine ORM, which may introduce integration challenges if your Laravel project uses Eloquent. You’ll need to either adopt Doctrine or create an adapter layer to bridge the two ORMs. Check compatibility with your existing database structure before proceeding.
What types of promotions does this package support (e.g., discounts, bundles, flash sales)?
The package supports standard promotions like discounts, product bundles, and flash sales out of the box. For custom promotion types (e.g., dynamic discounts or user segmentation), you may need to extend the core logic via service providers or traits, though this isn’t explicitly documented in the current release.
How do I handle conflicts if multiple promotions apply to the same product?
The package likely includes conflict resolution logic for overlapping promotions, but specifics aren’t detailed in the documentation. Test edge cases like concurrent promotions or cart conflicts in a staging environment. Consider implementing caching (e.g., Redis) for performance if conflicts arise during high traffic.
Are there any hidden dependencies or required baks-dev/* packages?
The package primarily depends on Doctrine and Symfony components, but no hidden `baks-dev/*` dependencies are listed. Always review the `composer.json` for transitive dependencies. If you’re concerned, pin exact versions in your `composer.json` to avoid surprises during updates.
How do I test the promotion logic before deploying to production?
Run PHPUnit tests with the group flag: `php bin/phpunit --group=products-promotion`. However, note that the package lacks integration or end-to-end tests, so manually test promotion workflows (e.g., applying discounts, bundle validation) in a staging environment mirroring production.
Can I extend or override the promotion logic without forking the package?
The package appears to follow Laravel’s service provider pattern, allowing you to override or extend core logic via service bindings or traits. Review the public API and documented hooks (if any) to customize behavior. Undocumented APIs may require reverse-engineering or direct contact with the maintainers.
What’s the rollback strategy if migrations fail or promotions need to be disabled?
Doctrine migrations support rollbacks via `php bin/console doctrine:migrations:rollback`. For disabling promotions without data loss, ensure your application logic includes soft-deletion flags or feature toggles. Test rollback scenarios in a non-production environment to confirm data integrity.
Does this package integrate with payment gateways like Stripe or PayPal for discount application?
The package does not explicitly mention payment gateway integrations (e.g., Stripe or PayPal) in its documentation. Discounts are likely applied at the cart or order level, so you’ll need to manually sync promotion logic with your payment processing workflows or use middleware to bridge the two systems.
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.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky