Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tarkhov/eloquent-validation

Laravel Eloquent model validation rules.
https://github.com/tarkhov/eloquent-validation

composer database db eloquent laravel orm php validation

Last synced: 2 months ago
JSON representation

Laravel Eloquent model validation rules.

Awesome Lists containing this project

README

        

# Eloquent validation

Laravel eloquent model validation rules.

### Contents

1. [Compatibility](#compatibility)
2. [Installation](#installation)
1. [Composer](#composer)
3. [Usage](#usage)
1. [Model rules](#model-rules)
2. [Model form request](#model-form-request)
4. [Author](#author)
5. [License](#license)

## Compatibility

Library | Version
------- | -------
Laravel | >=5.5

## Installation

### Composer

```bash
composer require tarkhov/eloquent-validation
```

## Usage

### Model rules

```php
'required|integer',
'is_active' => 'boolean',
'slug' => 'required|string|max:255',
'name' => 'required|string|max:255',
'description' => 'required|string|max:65535',
'image' => 'nullable|string|max:255',
'title' => 'required|string|max:255',
'meta_description' => 'required|string|max:255',
'meta_keywords' => 'required|string|max:255',
];
}
}
```

### Model form request

```php