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

Ajax Bundle Laravel Package

pdfloresjdav/ajax-bundle

A Symfony bundle for simplifying AJAX handling in PHP applications. It provides convenient helpers and configuration to reduce boilerplate when building asynchronous endpoints and interactive front-end features.

View on GitHub
Deep Wiki
Context7

Getting Started

Reality check before you install. This is a Symfony bundle, not a Laravel package — if you're working in a Laravel codebase, stop here and use Illuminate\Http\JsonResponse, $request->ajax(), and VerifyCsrfToken directly; there is nothing here you need. The bundle shows 0 stars, 0 dependents, and no ecosystem traction, so treat it as a vendored utility, not a maintained dependency. Pin the exact commit in composer.json rather than a caret/range constraint.

If you're inside a Symfony app:

  1. Install and register.

    composer require pdfloresjdav/ajax-bundle
    

    Then register the bundle in config/bundles.php (Symfony Flex will usually prompt for this automatically):

    Pdfloresjdav\AjaxBundle\AjaxBundle::class => ['all' => true],
    
  2. Look here first, in this order:

    • vendor/pdfloresjdav/ajax-bundle/src/ — find the main namespace and the class the bundle is named after. Because the package has no README traction, the source is the documentation.
    • Resources/config/services.yml (or services.php) — reveals whether it auto-registers any services or event subscribers.
    • DependencyInjection/ — tells you if there are configurable options (usually exposed via config/packages/ajax.yaml).
  3. Your first use case: return a structured AJAX payload from a controller. The typical reason to reach for an "AjaxBundle" is to avoid hand-rolling JSON envelopes. Wire it up minimally in a controller action that a fetch() or jQuery call hits:

    #[Route('/api/thing', methods: ['POST'])]
    public function thing(Request $request): Response
    {
        // whatever the bundle exposes for building an ajax-aware response
        return $this->ajaxResponse(['ok' => true, 'data' => $payload]);
    }
    

    Validate the shape by hitting the route with curl with and without X-Requested-With: XMLHttpRequest — the whole point of these bundles is that the response behavior differs, and you need to know which branch you're in before you build on it.

Recommended migration path: if the only thing the bundle gives you is a JsonResponse helper and an isXmlHttpRequest() convenience check, that's ~30 lines of your own AbstractController trait. Given the abandonment risk, writing that trait yourself is usually the correct day-one decision.

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