All Projects → spatie → Laravel Pjax

spatie / Laravel Pjax

Licence: mit
A pjax middleware for Laravel

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Laravel Pjax

Aimeos
Integrated online shop based on Laravel 8 and the Aimeos e-commerce framework
Stars: ✭ 2,354 (+383.37%)
Mutual labels:  laravel, performance
Meter
Laravel package to find performance bottlenecks in your laravel application.
Stars: ✭ 204 (-58.11%)
Mutual labels:  laravel, performance
Laravel Responsecache
Speed up a Laravel app by caching the entire response
Stars: ✭ 1,874 (+284.8%)
Mutual labels:  laravel, performance
Laravel Binary Uuid
Optimised binary UUIDs in Laravel
Stars: ✭ 523 (+7.39%)
Mutual labels:  laravel, performance
Enlightn
Your performance & security consultant, an artisan command away.
Stars: ✭ 378 (-22.38%)
Mutual labels:  laravel, performance
Laravel Blink
Cache that expires in the blink of an eye
Stars: ✭ 114 (-76.59%)
Mutual labels:  laravel, performance
Laravel Partialcache
Blade directive to cache rendered partials in laravel
Stars: ✭ 205 (-57.91%)
Mutual labels:  laravel, performance
Laravel Image Optimizer
Optimize images in your Laravel app
Stars: ✭ 873 (+79.26%)
Mutual labels:  laravel, performance
Laravel S
LaravelS is an out-of-the-box adapter between Swoole and Laravel/Lumen.
Stars: ✭ 3,479 (+614.37%)
Mutual labels:  laravel, performance
Laravel Varnish
Making Varnish and Laravel play nice together
Stars: ✭ 291 (-40.25%)
Mutual labels:  laravel, performance
Laravel Mix Preload
Add preload and prefetch links based your Mix manifest
Stars: ✭ 162 (-66.74%)
Mutual labels:  laravel, performance
Performance
⏱ PHP performance tool analyser your script on time, memory usage and db query. Support Laravel and Composer for web, web console and command line interfaces.
Stars: ✭ 429 (-11.91%)
Mutual labels:  laravel, performance
Laravel Zero
A PHP framework for console artisans
Stars: ✭ 2,821 (+479.26%)
Mutual labels:  laravel, performance
Laravel Model Cleanup
Clean up unneeded records
Stars: ✭ 388 (-20.33%)
Mutual labels:  laravel, performance
Iris
The fastest HTTP/2 Go Web Framework. AWS Lambda, gRPC, MVC, Unique Router, Websockets, Sessions, Test suite, Dependency Injection and more. A true successor of expressjs and laravel | 谢谢 https://github.com/kataras/iris/issues/1329 |
Stars: ✭ 21,587 (+4332.65%)
Mutual labels:  laravel, performance
Nimporter
Compile Nim Extensions for Python On Import!
Stars: ✭ 474 (-2.67%)
Mutual labels:  performance
Laravel Dompdf
A DOMPDF Wrapper for Laravel
Stars: ✭ 4,978 (+922.18%)
Mutual labels:  laravel
Laravel Multidomain
A Laravel extension for using a laravel application on a multi domain setting
Stars: ✭ 473 (-2.87%)
Mutual labels:  laravel
Android Tips Tricks
☑️ [Cheatsheet] Tips and tricks for Android Development
Stars: ✭ 4,496 (+823.2%)
Mutual labels:  performance
Laravel Blade Javascript
A Blade directive to export variables to JavaScript
Stars: ✭ 485 (-0.41%)
Mutual labels:  laravel

A pjax middleware for Laravel

Latest Version on Packagist Software License GitHub Workflow Status Total Downloads

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:

$ composer require spatie/laravel-pjax

Next you must add the \Spatie\Pjax\Middleware\FilterIfPjax-middleware to the kernel.

// app/Http/Kernel.php

...
protected $middleware = [
    ...
    \Spatie\Pjax\Middleware\FilterIfPjax::class,
];

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:

<meta http-equiv="x-pjax-version" content="{{ mix('/css/app.css') }}">

Multiple files:

<meta http-equiv="x-pjax-version" content="{{ mix('/css/app.css') . mix('/css/app2.css') }}">

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

$ composer test

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].