code-orange / turbolinks-location
Laravel middleware to insert Turbolinks-Location header into every response
Installs: 38 293
Dependents: 0
Suggesters: 0
Security: 0
Stars: 14
Watchers: 5
Forks: 0
Open Issues: 0
Requires
- illuminate/http: >=5.2
This package is auto-updated.
Last update: 2024-11-06 18:58:05 UTC
README
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.