Looking to hire Laravel developers? Try LaraJobs

laravel-validation-helper maintained by dev-talha-anwar

Description
This package is designed to use validation in laravel in very easy and efficient manner.
Author
Last update
2023/04/13 05:34 (dev-master)
License
Downloads
23

Comments
comments powered by Disqus

simple Utility for laravel validator

GitHub issues GitHub forks GitHub stars GitHub license

simple validation utility for laravel validation

Installation

You can install the package via composer:

composer require dev-talha-anwar/laravel-validation-helper

Publishing Config

after installation publish the configurtion

php artisan vendor:publish --provider=TalhaAnwar\LaravelValidationHelper\LaravelValidationHelperServiceProvider

Usage

after installation simply use trait in your controller on top

use talhaanwar\LaravelValidationHelper\Traits\LVH;

after that use fascade

$validated = LVH::validate(['Admin.AdminEditForm'], [
            [
                'key' => 'name',
                'value' => ['max:191'],
                'messages' => [
                    'password.string' => 'Password Must Be String.',
                    'password.min' => 'Too long Password.'
                ]
            ]
        ]);
        if (!is_array($validated)) :
            return $validated;
        endif;

or

$validated = LVH::validate(['Admin.AdminEditForm']);
        if (!is_array($validated)) :
            return $validated;
        endif;

or

$validated = LVH::validate([], [
            [
                'key' => 'name',
                'value' => ['max:191'],
                'messages' => [
                    'password.string' => 'Password Must Be String.',
                    'password.min' => 'Too long Password.'
                ]
            ]
        ]);
        if (!is_array($validated)) :
            return $validated;
        endif;

for simple form validation requests

$validated = LVH::validate(['Admin.AdminEditForm'],[],true);
        if (!is_array($validated)) :
            return $validated;
        endif;

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email 786anwartalha@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Laravel Package Boilerplate

This package was generated using the Laravel Package Boilerplate.