smart-over / base64-validation by smart-over
forked from crazybooot/base64-validation

Lumen validators for base64 encoded files
62
0
0
Package Data
Maintainer Username: smart-over
Package Create Date: 2019-02-28
Package Last Update: 2019-02-28
Language: PHP
License: Unknown
Last Refreshed: 2025-02-06 03:12:20
Package Statistics
Total Downloads: 62
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 0
Total Watchers: 0
Total Forks: 0
Total Open Issues: 0

Laravel validators for base64 encoded files, includes versions of laravel files validation for base64 encoded files.

Forked from https://github.com/crazybooot/base64-validation

Requirements

  • PHP: 7.1+
  • Laravel: 5.5+

Install

  • Install composer package to your laravel project
$ composer require smart-over/base64-validation

Using

Use base64 validation rules as usual Laravel validation rules. Base64 rules variants supports all parameters from their original Laravel rules.

public function rules(): array
{
   return [
       'attachment' => 'sometimes|base64dimensions:min_width=100,min_height=200',
   ];
}

Available rules

| base64 rule | analog of Laravel rule| |:---------------------|:----------------------| | base64max | max (for file) | | base64min | min (for file) | | base64dimensions | dimensions (for image)| | base64file | file | | base64image | image | | base64mimetypes | mimetypes | | base64mimes | mimes | | base64between | between (for file) | | base64size | size (for file) |

License

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