Skip to content

Installation Instructions

Tortue Torche edited this page Dec 13, 2017 · 15 revisions

In your Laravel application, edit the composer.json file. At the bottom, add or replace the line "minimum-stability": "stable" by:

    // bottom of your composer.json file, don't copy/paste this comment!
    "minimum-stability": "dev",
    "prefer-stable": true
}

See this file for a concrete example.

Then install the jQuery Laravel package:

composer require efficiently/jquery-laravel:2.2.*

If your Laravel version is below 5.5, add this service provider to your config/app.php file:

Efficiently\JqueryLaravel\JqueryLaravelServiceProvider::class,

You can now add this security Middleware to the $middleware variable, in your app/Http/Kernel.php file:

    protected $middleware = [
        //...
        \Efficiently\JqueryLaravel\VerifyJavascriptResponse::class,
    ];

Then, edit your app/Http/Controllers/Controller.php file to add the Efficiently\JqueryLaravel\ControllerAdditions trait:

//...
class Controller extends BaseController
{
    //...
    use \Efficiently\JqueryLaravel\ControllerAdditions;

    /**
     * The default layout path that should be used for responses.
     */
    protected $layout = 'layouts.app';
    //...
}

Then, you should read this page Complete tutorial with the Larasset package

Clone this wiki locally