PHPackages                             superbalist/laravel-ajax-redirector - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. superbalist/laravel-ajax-redirector

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

superbalist/laravel-ajax-redirector
===================================

A Laravel library for handling ajax redirects

2.0.0(9y ago)33.9k2[1 issues](https://github.com/Superbalist/laravel-ajax-redirector/issues)[1 PRs](https://github.com/Superbalist/laravel-ajax-redirector/pulls)MITPHPPHP &gt;=5.5.0

Since Jul 8Pushed 3y ago6 watchersCompare

[ Source](https://github.com/Superbalist/laravel-ajax-redirector)[ Packagist](https://packagist.org/packages/superbalist/laravel-ajax-redirector)[ RSS](/packages/superbalist-laravel-ajax-redirector/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (4)Used By (0)

laravel-ajax-redirector
=======================

[](#laravel-ajax-redirector)

A Laravel library for handling AJAX redirects

[![Author](https://camo.githubusercontent.com/abd4e3e2e71081ad01ef09a60c49d70c5e0677497f38918e740703cd02605078/687474703a2f2f696d672e736869656c64732e696f2f62616467652f617574686f722d40737570657262616c6973742d626c75652e7376673f7374796c653d666c61742d737175617265)](https://twitter.com/superbalist)[![StyleCI](https://camo.githubusercontent.com/0cab593403c3e201382604ce3d30e61fad7ae7efc8c944a90e8898969ecc952e/68747470733a2f2f7374796c6563692e696f2f7265706f732f36323838373931332f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/62887913)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Packagist Version](https://camo.githubusercontent.com/150a8ee91531e43279f60383c9fbc904c798e4408cfd900a54b697943ee3e6a6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f737570657262616c6973742f6c61726176656c2d616a61782d72656469726563746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/superbalist/laravel-ajax-redirector)[![Total Downloads](https://camo.githubusercontent.com/7bf77e0b51e3b0068ab6f47d2a1ecc8bfebc86f59d57c0b99292964b1a460934/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f737570657262616c6973742f6c61726176656c2d616a61782d72656469726563746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/superbalist/laravel-ajax-redirector)

This package changes the redirect response for AJAX calls from 301 or 302 to a 278 JSON response. XHR requests follow redirects which in a lot of cases, isn't the intention. In most cases, the intention is for the browser to redirect the client to the intended page.

For **Laravel 4**, please use version 1.0.0.

For **Laravel 5**, please use version 2.0.0+

Installation
------------

[](#installation)

```
composer require superbalist/laravel-ajax-redirector
```

Register the service provider in app.php

```
'providers' => [
    Superbalist\AjaxRedirector\AjaxRedirectServiceProvider::class,
]
```

Usage
-----

[](#usage)

In your application, you'll continue to do redirects like you always have.

```
return redirect()->to('/test');
```

In javascript, you'll need to watch for AJAX calls which result in HTTP 278 responses and do a client side redirect using eg: window.location.replace(json.redirect\_url);

With jQuery, this can be done using a Global AJAX Event Handler.

With AngularJS, this can be done using a $http interceptor.

The response from the server will look something like:

```
HTTP/1.1 278 unknown status
Content-Type: application/json

{"redirect_url":"http:\/\/your.site.com\/test"}

```

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 60% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~360 days

Total

2

Last Release

3285d ago

Major Versions

1.0.0 → 2.0.02017-07-04

### Community

Maintainers

![](https://www.gravatar.com/avatar/8b8f533cf5a84c29d3860ee32356f0554ead023247638ea952353fc2f01b2e5d?d=identicon)[superbalist](/maintainers/superbalist)

---

Top Contributors

[![matthewgoslett](https://avatars.githubusercontent.com/u/1571743?v=4)](https://github.com/matthewgoslett "matthewgoslett (6 commits)")[![shad0wfir3](https://avatars.githubusercontent.com/u/20926935?v=4)](https://github.com/shad0wfir3 "shad0wfir3 (2 commits)")[![danijelk](https://avatars.githubusercontent.com/u/580753?v=4)](https://github.com/danijelk "danijelk (1 commits)")[![johnmarkmassey](https://avatars.githubusercontent.com/u/7905749?v=4)](https://github.com/johnmarkmassey "johnmarkmassey (1 commits)")

---

Tags

ajaxhandling-ajax-redirectslaravellaravel-ajax-redirectorlaravel5laravel5-packagephpsuperbalist

### Embed Badge

![Health badge](/badges/superbalist-laravel-ajax-redirector/health.svg)

```
[![Health](https://phpackages.com/badges/superbalist-laravel-ajax-redirector/health.svg)](https://phpackages.com/packages/superbalist-laravel-ajax-redirector)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

77022.3M145](/packages/laravel-mcp)[anahkiasen/former

A powerful form builder

1.4k1.4M14](/packages/anahkiasen-former)[genealabs/laravel-caffeine

Keeping Your Laravel Forms Awake

9422.1M10](/packages/genealabs-laravel-caffeine)[watson/active

Laravel helper for recognising the current route, controller and action

3363.8M14](/packages/watson-active)[masmerise/livewire-toaster

Beautiful toast notifications for Laravel / Livewire.

510630.3k7](/packages/masmerise-livewire-toaster)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
