Skip to content

Laravel 5.3 installation

Pe Ell edited this page Jul 10, 2017 · 1 revision

Latest Stable Version Latest Unstable Version Total Downloads License

Modify composer.json

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

{
    "require": {
        "laravel/framework": "5.2.*",
        ...
        "proengsoft/laravel-jsvalidation": "^1.5"
    },
    ...
    "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 --provider="Proengsoft\JsValidation\JsValidationServiceProvider"
Clone this wiki locally