PHPackages                             gefar/laravel-form-ajax-validation - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. gefar/laravel-form-ajax-validation

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

gefar/laravel-form-ajax-validation
==================================

Make ajax validation with Laravel Requests for forms with bootstrap

5.6(7y ago)016MITPHPPHP &gt;=5.4.0

Since May 3Pushed 7y agoCompare

[ Source](https://github.com/gefar/laravel-form-ajax-validation)[ Packagist](https://packagist.org/packages/gefar/laravel-form-ajax-validation)[ Docs](https://github.com/gefar/laravel-form-ajax-validation)[ RSS](/packages/gefar-laravel-form-ajax-validation/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)Dependencies (1)Versions (3)Used By (0)

laravel-form-ajax-validation
============================

[](#laravel-form-ajax-validation)

Make ajax validation with Laravel Requests for forms with bootstrap

See the [full documentation.](https://github.com/guicho0601/laravel-form-ajax-validation/wiki)

\##Installation

### 1. Composer

[](#1-composer)

Add to the composer of your project

```
composer require lrgt/laravel-form-ajax-validation
```

Or edit your composer.json

```
"require": {
    "Gefar/laravel-form-ajax-validation": "dev-master"
},
```

### 2. Add the ServiceProvider

[](#2-add-the-serviceprovider)

Open the file config/app.php

```
"providers": {
    ...
    'Gefar\LaravelFormAjaxValidation\LaravelFormAjaxValidationServiceProvider',
    ...
},
```

### 3. Publish vendor resources

[](#3-publish-vendor-resources)

You need to publish the necessary views for create the scripts of jQuery

```
$ php artisan vendor:publish
```

### 4. Laravel Request

[](#4-laravel-request)

Create a request

```
$ php artisan make:Request TestRequest
```

Add the rules

```
public function rules()
{
	return [
          'name'=>'required|max:5',
          'description'=>'required',
          'tags'=>'required|min:3',
	];
}
```

You also can add to the request custom error messages and change de attributes name

```
public function messages()
{
	return [
          'name.required'=>'Do not forget your name',
          'description.required'=>'You need the description',
          'name.max'=>'Your name have less than 5 letters?',
	];
}

public function attributes(){
        return [
            'name'=>'Your name',
            'tags'=>'The tags',
        ];
    }
```

### 5. Add to the view

[](#5-add-to-the-view)

Create your form

```
