Download the PHP package jshibu86/validator without Composer
On this page you can find all versions of the php package jshibu86/validator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jshibu86/validator
More information about jshibu86/validator
Files in jshibu86/validator
Package validator
Short Description A Laravel package to generate validation rules for database tables
License MIT
Informations about the package validator
Schema Validation Generator
Schema Validation Generator is a Laravel package designed to simplify the creation of validation rules for database tables. This package dynamically generates a validation array based on the schema of a specified table, helping you reduce manual effort and improve consistency.
Features
- Generate validation rules for any database table with a single command.
- Automatically detects column properties such as
nullable,type, andlengthto create appropriate rules. - Supports common validation rules like
required,nullable,string,integer,numeric,boolean,date, and more. - Provides a clean, readable output in PHP array format.
Installation
To install the package, run: Latest Version:
Latest 1.x.x version:
Version 1.0.0:
Latest 2.x.x version:
Usage
After Installed Follow the steps.
Step1:
Add the Service provider to app.php,
Step1:
Use the service to the controller ,
Command(only for older versions : 1.0,1.0.0)
Replace {tableName} with the name of the table you want to validate.
Example (only for older versions : 1.0,1.0.0)
For a table named users with the following schema:
| Column | Type | Nullable | Length | Extra |
|---|---|---|---|---|
| id | BIGINT | NO | - | Auto Increment |
| name | VARCHAR | NO | 255 | |
| VARCHAR | YES | 255 | ||
| phone | VARCHAR | NO | 255 | |
| note | TEXT | YES | - | |
| created_at | TIMESTAMP | YES | - | |
| updated_at | TIMESTAMP | YES | - |
Running the command:
Will output:
Customization
This package is designed to work out of the box, but you can extend or modify it if needed by publishing the config file.
Select the Provider: Schema\ValidationGenerator\ValidationGeneratorServiceProvider option. Then edit the resources/vendor/Schema-validation-generator/validationGeneratorConfig.json to match your database's column types.
Contributing
Contributions are welcome! Feel free to fork the repository and submit pull requests for improvements.
License
This package is open-source and licensed under the MIT License.
Support
For issues or questions, please open an issue on the GitHub repository .
Credits
Developed with ❤️
Let me know if you’d like to refine this further!