New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

nikhilbhatia22/laravel-validator-color

Validate that a certain value is a valid CSS color string in Laravel 5 and above
32,815 1
Install
composer require nikhilbhatia22/laravel-validator-color
Latest Version:v11.0.0
PHP:^5.5.9|^7.0|^8.0|^8.1|^8.2|^8.3
Laravel:5 – 11
License:MIT
Last Updated:Sep 30, 2024
Links: GitHub  ·  Packagist
Maintainer: nikhilbhatia22

Validate colors with Laravel 5 and above

Latest Version Software License For Laravel 5

This package will let you validate that a certain value is a valid CSS color string.

Installation

Install via composer - In the terminal:

composer require nikhilbhatia22/laravel-validator-color

For Laravel version below 5.5, add the following to the providers array in your config/app.php

Nikhilbhatia22\Validator\Color\ServiceProvider::class

Usage

// Test any color type
Validator::make(['test' => '#454ACF'], ['test' => 'color']);

// Test for rgb 
Validator::make(['test' => 'rgb(0, 200, 150)'], ['test' => 'color_rgb']);

// Test for rgba 
Validator::make(['test' => 'rgba(0, 200, 150, 0.52)'], ['test' => 'color_rgba']);

// Test for hex 
Validator::make(['test' => '#333'], ['test' => 'color_hex']);

// Test for css color keyword 
Validator::make(['test' => 'gold'], ['test' => 'color_keyword']);

Related Packages

tylercd100/laravel-validator-color

Validate that a certain value is a valid CSS color string in Laravel 5

81,752 15
russoedu/colorvalidator

Custom Laravel 5 Validator for hexadecimal color

55 2
scybulski/laravel-validator-color

Validate that a certain value is a valid CSS color string in Laravel

2,223 0
dartui/polish-validators

Polish Validators for Laravel

1,574 4

Version History

Version Released PHP Laravel License
v11.0.0 ^5.5.9|^7.0|^8.0|^8.1|^8.2|^8.3 ^5.0|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0 MIT
v7.0.0 ^5.5.9|^7.0|^8.0|^8.1 ^5.0|^6.0|^7.0|^8.0|^9.0|^10.0 MIT
v6.0.0 ^5.5.9|^7.0|^8.0 ^5.0|^6.0|^7.0|^8.0|^9.0 MIT
v5.0.0 ^7.3|^8.0 ^7.0|^8.0 MIT
v4.0.4 ^5.5.9|^7.0 ^5.0|^6.0|^7.0 MIT