Skip to content

Laravel middleware to insert Turbolinks-Location header into every response

License

Notifications You must be signed in to change notification settings

code-orange/turbolinks-location

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Turbolinks Location middleware for Laravel

This package contains a Laravel middleware for working with Turbolinks. It sets the Turbolinks-Location header on every response served, so that Turbolinks always shows the correct URL after redirects.

Installation

composer require code-orange/turbolinks-location

Usage

In your App\Http\Kernel, add the middleware to your web group:

use CodeOrange\TurbolinksLocation\TurbolinksLocation;

class Kernel extends HttpKernel {
    protected $middlewareGroups = [
        'web' => [
            ...,
            TurbolinksLocation::class
        ],
    ];
}

That's it! All requests to routes in your web.php route file will now be served with a correct Turbolinks-Location header.

About

Laravel middleware to insert Turbolinks-Location header into every response

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages