onexcrm / valiper
A simple laravel validation utility helper
v1.0.1
2023-02-20 20:31 UTC
This package is auto-updated.
Last update: 2024-12-21 00:49:08 UTC
README
A simple laravel validation utility helper
Installation
composer require onexcrm/valiper
Laravel without auto-discovery:
If you don't use auto-discovery, add the ServiceProvider to the providers array in config/app.php
Onex\Valiper\OnexValiperServiceProvider::class,
If you want to use the facade to log messages, add this to your facades in app.php:
'OnexValiper'=> Onex\Valiper\Valiper\ValiperClassFacade::class,
How to use?:
/** * @param array $formData * @param array $rules * @param array $messages * @return void */ $validator = OnexValiper::checkInputValidation($formRequestData, $validationRules, $validationMessages); dd($validator);
Utility helper functions:
Pass the $validator from above function in all helper functions as per your requirement
$result = OnexValiper::inputValidationObjectFormat($validator); dd($result);
$result = OnexValiper::inputValidationArrayFormat($validator); dd($result);
$result = OnexValiper::inputValidationJsonResponseFormat($validator); dd($result);
$result = OnexValiper::inputValidationJsonFormat($validator); dd($result);
$result = OnexValiper::inputValidationJsonObjectFormat($validator); dd($result);
$result = OnexValiper::inputValidationKeyValuePairFormat($validator); dd($result);
$result = OnexValiper::inputValidationFirstMessage($validator); dd($result);
Feel free to contact me: Arindam Roy arindam.roy.developer@gmail.com