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 Favorite

Products Favorite Laravel Package

baks-dev/products-favorite

Laravel/PHP module for managing product favorites (wishlist): add/remove products to a user’s favorites, store and retrieve favorite lists, and integrate into e-commerce product pages. Requires PHP 8.4+.

View on GitHub
Deep Wiki
Context7

composer require baks-dev/products-favorite

Frequently asked questions about Products Favorite
How do I install baks-dev/products-favorite in a Laravel project?
Run `composer require baks-dev/products-favorite` in your project directory. The package supports Laravel 7.x+ and PHP 8.4+, with no additional configuration required for basic functionality. Ensure your Laravel app meets these version requirements before installation.
Does this package work with Laravel 10.x?
The package is officially tested for Laravel 7.x+, but no explicit Laravel 10.x compatibility is documented. Validate compatibility by checking for deprecation warnings or breaking changes in the changelog, or test thoroughly in a staging environment before upgrading.
Can I customize the database schema or add indexes for performance?
The package does not explicitly document schema changes, so you’ll need to manually add foreign keys (e.g., `user_id`, `product_id`) and indexes for optimal performance. Use Laravel migrations to extend the default schema if needed, ensuring constraints align with your application’s requirements.
How do I integrate favorites into my e-commerce product pages?
Use the `Favorite` facade or service class to toggle favorites (e.g., `Favorite::toggle($productId)`). The package provides Eloquent models and middleware for seamless integration. For Blade views, check if `vendor:publish` supports publishing assets or manually create views using the provided logic.
Are there any events or hooks for extending functionality (e.g., notifications)?
The package likely emits events like `FavoriteAdded` or `FavoriteRemoved`, but documentation is minimal. Test these events in your codebase and extend them via Laravel’s event system. For notifications, integrate with Laravel’s `Notifiable` trait or third-party packages like `laravel-notification-channels`.
Does this package support bulk operations (e.g., adding multiple products at once)?
The package focuses on single-product operations (add/remove). For bulk actions, you’ll need to extend the service layer or use Laravel’s query builder to batch-insert records. Consider alternatives like Spatie’s Wishlist if bulk operations are critical to your use case.
How do I test if the package works in my Laravel application?
Run `php bin/phpunit --group=products-favorite` to execute the package’s tests. For integration testing, verify `Favorite` model interactions, middleware, and event listeners. Test edge cases like duplicate entries, unauthorized access, and concurrency issues in a controlled environment.
Is there a way to publish config or Blade views for customization?
The package may support `vendor:publish`, but this isn’t explicitly documented. Check the `config` and `resources/views` directories after installation. If missing, manually publish assets or extend the package via service providers or middleware.
What are the performance considerations for high-traffic applications?
Monitor for N+1 query issues when fetching favorites, especially in large-scale apps. Optimize with eager loading (`with()`) or caching (`Cache::remember`). The package may lack built-in rate-limiting, so implement queueable jobs for `FavoriteAdded` events if needed.
How does this compare to Spatie’s Wishlist package for Laravel?
Spatie’s Wishlist offers advanced features like bulk actions, real-time updates, and more extensive documentation. This package is lightweight and focused on core functionality, making it ideal for simple use cases. Evaluate feature parity based on your project’s needs, especially if you require scalability or complex workflows.
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.
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
spatie/mailcoach-vapor