PHPackages                             devmatic/laravel-instantclick - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. devmatic/laravel-instantclick

ActiveLibrary

devmatic/laravel-instantclick
=============================

An InstantClick middleware for Laravel 5

v1.1.0(10y ago)491633MITJavaScriptPHP ^5.5.0|^7.0

Since Feb 9Pushed 10y ago5 watchersCompare

[ Source](https://github.com/devmatic/laravel-instantclick)[ Packagist](https://packagist.org/packages/devmatic/laravel-instantclick)[ Docs](https://github.com/devmatic/laravel-instantclick)[ RSS](/packages/devmatic-laravel-instantclick/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (6)Versions (7)Used By (0)

An InstantClick middleware for Laravel 5
========================================

[](#an-instantclick-middleware-for-laravel-5)

[![Latest Version on Packagist](https://camo.githubusercontent.com/1352cb9981639207f597c5588e38a9c17b3865651e66c1c57d0f9eebc7b6d5ad/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6465766d617469632f6c61726176656c2d696e7374616e74636c69636b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/devmatic/laravel-instantclick)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/08e9a8472102257b418ee31a5ae54be4a4d4b2de7ce0a425ed305d77dc3acf86/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6465766d617469632f6c61726176656c2d696e7374616e74636c69636b2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/devmatic/laravel-instantclick)[![SensioLabsInsight](https://camo.githubusercontent.com/42f44c814a4ed669f3ff8b033b734b3da2a8cb2b5c4c4b4755257c48473224ba/68747470733a2f2f696d672e736869656c64732e696f2f73656e73696f6c6162732f692f35656135663365382d653566642d343362362d386238392d3763363834353836386565652e7376673f7374796c653d666c61742d737175617265)](https://insight.sensiolabs.com/projects/4c4ada94-d590-4c27-9118-dad4b5bebe73)[![Quality Score](https://camo.githubusercontent.com/a3fcdd31182c7c8336dd60ac75874d014b701aa0a131105170a7541c4d552db5/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6469616166617265732f6c61726176656c2d696e7374616e74636c69636b2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/devmatic/laravel-instantclick)[![Total Downloads](https://camo.githubusercontent.com/5fda36f13a81f3745bb21b05bbe6e2efd3c2b118b0b93f020639c5e71eab0b16/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6465766d617469632f6c61726176656c2d696e7374616e74636c69636b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/devmatic/laravel-instantclick)

[InstantClick](https://github.com/dieulot/instantclick) is a plugin that makes following links in your website instant by leverages ajax to speed up the loading time of your pages.

InstantClick uses pushState and Ajax (a combo known as pjax), replacing only the body and the title in the head.

Devmatic is a web development company aims to make developers life easier. You’ll find an overview of all our projects on our [website](http://devmatic.co).

Ajax brings two nice benefits in and of itself:
===============================================

[](#ajax-brings-two-nice-benefits-in-and-of-itself)

- ```
    Your browser doesn’t have to throw and recompile scripts and styles on each page change anymore.

    ```
- ```
    You don’t get a white flash while your browser is waiting for a page to display, making your website feel faster.

    ```

This package provides a middleware that can return the response that this plugin expects.

Video Tutorial &amp; Overview
-----------------------------

[](#video-tutorial--overview)

[![IMAGE ALT TEXT HERE](https://camo.githubusercontent.com/505285cf98eff13f34b0821960a61f9ca33c9d9e5ec5bb385a5dd7d9376fd2a9/687474703a2f2f696d672e796f75747562652e636f6d2f76692f49477638647a44357251412f302e6a7067)](http://www.youtube.com/watch?v=IGv8dzD5rQA)

Installation &amp; Usage
------------------------

[](#installation--usage)

- You can install the package via composer:

```
$ composer require devmatic/laravel-instantclick
```

- Next you must add the `\Devmatic\InstantClick\Middleware\FilterIfInstantClick`-middleware to the kernel.

```
// app/Http/Kernel.php

...
protected $middleware = [
    ...
    \Devmatic\InstantClick\Middleware\FilterIfInstantClick::class,
];
```

- **Copy the included instantclick.js** to your proper public asset folder then include it at your layout file like this:

```

    InstantClick.init();
```

- Please refer to [InstantClient documentation](http://instantclick.io/documentation) to know more about InstantClient options and how it works.

Important Note
--------------

[](#important-note)

please use the included instantclick.js file because I modify it by adding $xhr.setRequestHeader(‘X-INSTANTCLICK’, true) to give the middleware the ability to identify InstantClient requests and give the proper response to it.

How it Works
------------

[](#how-it-works)

The provided middleware provides the behaviour that the Instant Click plugin expects of the server:

> An X-INSTANTCLICK request header is set to differentiate a InstantClick request from normal XHR requests. In this case, if the request is InstantClick, we skip the layout html and just render the inner contents of the body.

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Diaa Fares](https://github.com/DiaaFares)
- [All Contributors](../../contributors)

The middleware in this package was originally written by [Freek Van der Herten](https://github.com/freekmurze) for return the response that Pjax jquery plugin expects, I edit his middleware and InstantClick plugin to make it work for Laravel. His original code can be found [in this repo on GitHub](https://github.com/spatie/laravel-pjax).

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~3 days

Total

6

Last Release

3728d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/aa8cfc3bd4d1e00727af7ed4ae85b5d93045244056617420b0dc0da3230cf2fd?d=identicon)[devmatic](/maintainers/devmatic)

---

Top Contributors

[![diaafares](https://avatars.githubusercontent.com/u/1811607?v=4)](https://github.com/diaafares "diaafares (16 commits)")

---

Tags

laraveldiaafaresLaravel-InstantClickinstantclickDevmatic

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/devmatic-laravel-instantclick/health.svg)

```
[![Health](https://phpackages.com/badges/devmatic-laravel-instantclick/health.svg)](https://phpackages.com/packages/devmatic-laravel-instantclick)
```

###  Alternatives

[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[tzsk/sms

A robust and unified SMS gateway integration package for Laravel, supporting multiple providers.

320244.3k6](/packages/tzsk-sms)[api-platform/laravel

API Platform support for Laravel

59126.4k6](/packages/api-platform-laravel)[kerigard/laravel-lang-ru

Ru lang for Laravel

2116.8k](/packages/kerigard-laravel-lang-ru)[truckersmp/steam-socialite

Laravel Socialite provider for Steam OpenID.

1516.7k](/packages/truckersmp-steam-socialite)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
