2017 © Pedro PelĂĄez
 

library laravel-instantclick

An InstantClick middleware for Laravel 5

image

devmatic/laravel-instantclick

An InstantClick middleware for Laravel 5

  • Friday, February 26, 2016
  • by devmatic
  • Repository
  • 5 Watchers
  • 49 Stars
  • 144 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 7 Versions
  • 1 % Grown

The README.md

An InstantClick middleware for Laravel 5

Latest Version on Packagist Software License Build Status SensioLabsInsight Quality Score Total Downloads, (*1)

InstantClick is a plugin that makes following links in your website instant by leverages ajax to speed up the loading time of your pages., (*2)

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

Devmatic is a web development company aims to make developers life easier. You’ll find an overview of all our projects on our website., (*4)

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., (*5)

Video Tutorial & Overview

IMAGE ALT TEXT HERE, (*6)

Installation & Usage

  • You can install the package via composer: ``` bash $ composer require devmatic/laravel-instantclick

- Next you must add the `\Devmatic\InstantClick\Middleware\FilterIfInstantClick`-middleware to the kernel. ```php // 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:
    
    <script data-no-instant>InstantClick.init();</script>

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., (*7)

How it Works

The provided middleware provides the behaviour that the Instant Click plugin expects of the server:, (*8)

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., (*9)

Change log

Please see CHANGELOG for more information what has changed recently., (*10)

Testing

bash $ composer test, (*11)

Contributing

Please see CONTRIBUTING for details., (*12)

Credits

The middleware in this package was originally written by Freek Van der Herten 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., (*13)

License

The MIT License (MIT). Please see License File for more information., (*14)

The Versions

26/02 2016

dev-master

9999999-dev https://github.com/devmatic/laravel-instantclick

An InstantClick middleware for Laravel 5

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel diaafares laravel-instantclick instantclick devmatic

26/02 2016

v1.1.0

1.1.0.0 https://github.com/devmatic/laravel-instantclick

An InstantClick middleware for Laravel 5

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel diaafares laravel-instantclick instantclick devmatic

16/02 2016

1.0.4

1.0.4.0 https://github.com/diaafares/laravel-instantclick

An InstantClick middleware for Laravel 5

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel diaafares laravel-instantclick instantclick

11/02 2016

1.0.3

1.0.3.0 https://github.com/diaafares/laravel-instantclick

An InstantClick middleware for Laravel 5

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel diaafares laravel-instantclick instantclick

11/02 2016

1.0.2

1.0.2.0 https://github.com/diaafares/laravel-instantclick

An InstantClick middleware for Laravel 5

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel diaafares laravel-instantclick instantclick

10/02 2016

1.0.1

1.0.1.0 https://github.com/diaafares/laravel-instantclick

An InstantClick middleware for Laravel 5

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel diaafares laravel-instantclick instantclick

10/02 2016

1.0

1.0.0.0 https://github.com/diaafares/laravel-instantclick

An InstantClick middleware for Laravel 5

  Sources   Download

MIT

The Requires

 

The Development Requires

diaafares laravel-instantclick instantclick