https://github.com/joeri-abbo/php-smart-validation
Laravel validation rules generated based on given table
https://github.com/joeri-abbo/php-smart-validation
database laravel requests validation
Last synced: 3 months ago
JSON representation
Laravel validation rules generated based on given table
- Host: GitHub
- URL: https://github.com/joeri-abbo/php-smart-validation
- Owner: Joeri-Abbo
- Created: 2022-04-27T13:55:45.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-05-13T20:03:35.000Z (about 4 years ago)
- Last Synced: 2025-06-10T01:19:58.633Z (about 1 year ago)
- Topics: database, laravel, requests, validation
- Language: PHP
- Homepage:
- Size: 50.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Smart validation
Setup easy validation without any configure except your database configuration.
What this package does is getting your settings of the colums from your given table and generate a validation rules for
your.
## Installation
Run the following command to install the package.
```
composer require joeriabbo/smart-validation
```
After installing go to your request that normaly would extend FormRequest and now extend SmartValidation.
```
use JoeriAbbo\SmartValidation\Http\Requests\AbstractTableValidationRequest;
class StoreRequest extends AbstractTableValidationRequest
```
Now you have to add the table name by filling the table function.
Inside your validation class.
```
public static function getTable(): string
{
return 'demo';
}
```
The validation rules are generated by the package. And your validation rules are now the same as your database table
rules.