Skip to content

Installation

albertmoreno edited this page Sep 30, 2015 · 47 revisions

Latest Stable Version Total Downloads Latest Unstable Version License

Update composer.json

To install this package add proengsoft/laravel-jsvalidation:~1.1 in your composer.json You should upate post-update-cmd scripts section to ensure that the Javascript assets are updated.

{
    "require": {
        "laravel/framework": "5.1.*",
        ...
        "proengsoft/laravel-jsvalidation": "~1.1"
    },
    ...
    "scripts": {
        "post-update-cmd": [
            ....
            "php artisan vendor:publish --provider=\"Proengsoft\\JsValidation\\JsValidationServiceProvider\" --tag=public --force"
        ],
    },
}

Run composer update command to install the package.

$ composer update

Configure Laravel

To configure Laravel, simply edit /config/app.php file and add the JsValidationServiceProvider and JsValidatoralias as below:

    'providers' => array(
        ...
        Proengsoft\JsValidation\JsValidationServiceProvider::class,
    ),
    'alias' => array(
        ...
        'JsValidator' => Proengsoft\JsValidation\Facades\JsValidatorFacade::class,
    ),

Publish assets

Also you need to publish configuration file, Javascript assets and views by running the following Artisan commands.

$ php artisan vendor:publish

Upgrade from previous versions

If you are upgrading the package from previous version you should ensure that the published Javascripts versions match with the vendor files.

Republish the Javascript assets after composer update

php artisan vendor:publish --provider="Proengsoft\JsValidation\JsValidationServiceProvider" --force

This command will overwrite settings and package view

and make sure that your composer.json file is configured according this guide.

Clone this wiki locally