Skip to content

Laravel 7.x installation

LocalHeroPro edited this page May 3, 2020 · 4 revisions

Latest Stable Version Latest Unstable Version Total Downloads License

Require dependency

$ composer require proengsoft/laravel-jsvalidation

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"

Change bootstrap version

By default we use bootstrap to render Javascript validation code. You may want to change the version of bootstrap to bootstrap4 in config/jsvalidation.phpby editing that line:

'view' => 'jsvalidation::bootstrap4',

Keep in mind to copy your files using mix, so add in webpack.mix.js file

mix.copy('vendor/proengsoft/laravel-jsvalidation/resources/views', 'resources/views/vendor/jsvalidation')
    .copy('vendor/proengsoft/laravel-jsvalidation/public', 'public/vendor/jsvalidation');

and add these files to .gitignore to prevent them being tracked

/resources/views/vendor/
/public/vendor/

After that Laravel project preparation You can use thet package like on this example: https://github.com/proengsoft/laravel-jsvalidation/wiki/FormRequest-Validation-Example

Clone this wiki locally