penance316 / laravel-base64-validator
laravel base64 validation package
Installs: 20 025
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=5.4.0
- illuminate/support: >=5.0.0
Requires (Dev)
- phpunit/phpunit: >=4.0
This package is auto-updated.
Last update: 2024-11-09 22:49:49 UTC
README
Install
composer require "penance316/laravel-base64-validator"
Add the required validator to boot method of app/Providers/AppServiceProvider.php
Validator::extend('base64', 'Penance316\Validators\Base64Validator@validateBase64');
Add the following lines to resources/lang/en/validation.php
'base64' => 'The :attribute must be a valid Base64 string.',
Use like other validators
...
'reference' => 'required|max:255',
'data' => 'required|base64',
'email' => 'required|email',
...
Test
Use vendor phpunit
./vendor/phpunit/phpunit/phpunit --testdox