Weave 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

Amazon Search Bundle Laravel Package

uam/amazon-search-bundle

UAM Amazon Search Bundle is a Symfony bundle that wraps Amazon Product Advertising API search, letting you query products by keyword and render results in your templates through configurable bundle settings. It has no stars or visibility, so vet maintenance before adopting.

View on GitHub
Deep Wiki
Context7

Getting Started

  1. Add the package with composer require uam/amazon-search-bundle. Expect dependency resolution to fight you: this is a Symfony 2.x bundle, so its composer.json almost certainly pins symfony/* to ~2.x and an old PHP range. In a modern Laravel app you will likely need --ignore-platform-reqs or a fork with relaxed constraints.
  2. Because Laravel does not understand Symfony bundles, there is no auto-discovery. Open vendor/uam/amazon-search-bundle and read, in this order:
    • the *Bundle.php class (the bundle name and namespace),
    • Resources/config/services.yml (service IDs and constructor arguments),
    • DependencyInjection/*Extension.php (the config keys you can set),
    • any Controller/ or *Search*.php class (the actual entry point).
  3. Treat the bundle's core class as a plain PHP object. The lowest-friction first use case is a tiny Laravel wrapper:
// app/Services/AmazonSearch.php
class AmazonSearch
{
    public function search(string $term): array
    {
        $client = new \UAM\AmazonSearchBundle\...\Search(...);
        return $client->search($term); // whatever the bundle exposes
    }
}

// routes/web.php
Route::get('/search', fn () => app(AmazonSearch::class)->search(request('q')));
  1. Confirm what the bundle actually returns before building on it. It is a "search page as a bundle", so it may return rendered HTML rather than a structured product array — in which case your first task is parsing, not integration.

Implementation Patterns

Wrap it in a service provider. Bind the bundle's search class as a singleton in AppServiceProvider (or a dedicated provider) and translate the bundle's YAML config into Laravel config values. This isolates every use UAM\... statement to one file, so a future fork or replacement is a one-line change.

$this->app->singleton(AmazonSearch::class, function ($app) {
    return new AmazonSearch(config('services.amazon_search'));
});

Cache aggressively. Amazon search pages are slow and rate-limited. Wrap the call:

return Cache::remember("amazon:search:{$term}", now()->addHours(6), fn () =>
    $this->amazon->search($term)
);

Push bulk searches onto a queue. A job per search term, with RateLimited middleware or a sleep, keeps you from hammering Amazon and getting blocked. Store raw responses so you can re-parse without re-fetching.

Normalize the output behind your own contract. Define a ProductSearch interface (search(string $term): Collection) and make the bundle an implementation. This gives you a seam for tests, a fake, and an escape hatch when the scraper breaks.

Use a console command for scheduled work. php artisan amazon:search {term} is far more convenient for debugging than a browser route, and it lets you dump raw HTML to storage/app/amazon/ for inspection.

Test with fixtures. Because the bundle likely produces HTML, capture a real response once and assert your parser against the fixture — never hit Amazon in the test suite.

Gotchas and Tips

  • This is not a Laravel package. No service provider, no facade, no config publish. You are manually wiring a Symfony 2 bundle. Budget time for the adapter layer, not the search itself.
  • Composer is the first boss fight. Old symfony/* and PHP constraints will conflict with Laravel. Options: --ignore-platform-reqs, a local fork with loosened constraints, or vendoring just the search class out of the bundle. The last is often cleanest for a 0-star, 0-dependent package.
  • Symfony 2 is EOL. Do not assume compatibility with PHP 8+; old code may use deprecated syntax, each(), or removed reflection behavior. Run it under a pinned runtime or refactor.
  • Scraping is brittle by nature. Amazon's markup changes constantly and will silently break parsing. Log the raw HTML on parse failures and set up an alert when your result count drops to zero.
  • Legal and anti-bot risk. Amazon's ToS restricts scraping; expect CAPTCHAs, 503s, and IP blocks. Build in backoff and rotate/limit from day one. For anything production-grade, use the official Product Advertising API instead of a scraper.
  • Config quirks. The bundle's DI extension likely expects a specific alias (e.g. uam_amazon_search) and nested keys. Mirror them exactly in a Laravel config array rather than trying to load the bundle's YAML through Laravel's config system.
  • Debugging tip: inspect the underlying service arguments. If the bundle builds a Guzzle client or a crawler internally, override it by binding your own instance — Guzzle middleware is the easiest place to log requests and responses.
  • Extension points are limited. With no tests, no stars, and no maintainers, expect to fork. Keeping the bundle behind your own interface makes that fork a contained change rather than a rewrite.
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.
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums
rlacerda83/query-parser
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings