Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/tarkhov/eloquent-validation
- Owner: tarkhov
- License: mit
- Created: 2018-08-13T00:54:52.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2022-01-13T00:27:09.000Z (almost 3 years ago)
- Last Synced: 2024-09-30T22:41:01.607Z (3 months ago)
- Topics: composer, database, db, eloquent, laravel, orm, php, validation
- Language: PHP
- Homepage:
- Size: 20.5 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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