Download the PHP package spatie/laravel-pjax without Composer
On this page you can find all versions of the php package spatie/laravel-pjax. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download spatie/laravel-pjax
More information about spatie/laravel-pjax
Files in spatie/laravel-pjax
Package laravel-pjax
Short Description A pjax middleware for Laravel 5
License MIT
Homepage https://github.com/spatie/laravel-pjax
Informations about the package laravel-pjax
A pjax middleware for Laravel
Pjax is a jQuery plugin that leverages ajax to speed up the loading time of your pages. It works by only fetching specific html fragments from the server, and client-side updating only happens on certain parts of the page.
The package provides a middleware that can return the response that the jQuery plugin expects.
There's a Vue-PJAX Adapter equivalent by @barnabaskecskes which doesn't require jQuery.
Spatie is a webdesign agency based in Antwerp, Belgium. You'll find an overview of all our open source projects on our website.
Support us
We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.
We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.
Installation
You can install the package via composer:
Next you must add the \Spatie\Pjax\Middleware\FilterIfPjax
-middleware to the kernel.
Usage
The provided middleware provides the behaviour that the pjax plugin expects of the server:
An X-PJAX request header is set to differentiate a pjax request from normal XHR requests. In this case, if the request is pjax, we skip the layout html and just render the inner contents of the container.
Laravel cache busting tip
When using Laravel Mix to manage your frontend cache busting, you can use it to your advantage to bust pjax's cache. Simply include the mix
method as the content of the x-pjax-version
meta tag:
Multiple files:
This way, anytime your frontend's cache gets busted, pjax's cache gets automatically busted as well!
Changelog
Please see CHANGELOG for more information what has changed recently.
Testing
Contributing
Please see CONTRIBUTING for details.
Security
If you've found a bug regarding security please mail [email protected] instead of using the issue tracker.
Credits
- Freek Van der Herten
- All Contributors
The middleware in this package was originally written by Jeffrey Way for the Laracasts-lesson on pjax. His original code can be found in this repo on GitHub.
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-pjax with dependencies
illuminate/support Version ^6.0|^7.0|^8.0|^9.0|^10.0|^11.0
illuminate/http Version ^6.0|^7.0|^8.0|^9.0|^10.0|^11.0
symfony/dom-crawler Version ^4.0|^5.0|^6.0|^7.0
symfony/css-selector Version ^4.0|^5.0|^6.0|^7.0