Torann / laravel-pjax-middleware by torann

Enable the use of PJAX in Laravel.
86
2
3
Package Data
Maintainer Username: torann
Maintainer Contact: daniel@lyften.com (Daniel Stainback)
Package Create Date: 2015-08-05
Package Last Update: 2018-02-01
Language: PHP
License: BSD-2-Clause
Last Refreshed: 2024-02-22 03:09:54
Package Statistics
Total Downloads: 86
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 2
Total Watchers: 3
Total Forks: 2
Total Open Issues: 1

Laravel PJAX Middleware

Enable the use of PJAX in Laravel.

Installation

Install using composer:

$ composer require torann/laravel-pjax-middleware

You'll then need to run composer install to download it and have the autoloader updated.

Setup

Once installed you need to append the middleware class within the Http kernel. Open up app/Http/Kernel.php and find the $middleware variable.

protected $middleware = [

    Torann\Pjax\PjaxMiddleware::class,

]

How to use

This middleware will check, before outputting the http response, for the X-PJAX's header in the request. If found, it will crawl the response to return the requested element defined by X-PJAX-Container's header.

Works great with flight-with-pjax and jquery.pjax.js.