| Package Data | |
|---|---|
| Maintainer Username: | tylercd100 |
| Maintainer Contact: | tylercd100@gmail.com (Tyler Arbon) |
| Package Create Date: | 2016-05-10 |
| Package Last Update: | 2020-11-04 |
| Language: | PHP |
| License: | MIT |
| Last Refreshed: | 2025-10-27 03:13:55 |
| Package Statistics | |
|---|---|
| Total Downloads: | 79,317 |
| Monthly Downloads: | 61 |
| Daily Downloads: | 0 |
| Total Stars: | 14 |
| Total Watchers: | 4 |
| Total Forks: | 24 |
| Total Open Issues: | 3 |
This package will let you validate that a certain value is a valid CSS color string.
Install via composer - In the terminal:
composer require tylercd100/laravel-validator-color
Now add the following to the providers array in your config/app.php
Tylercd100\Validator\Color\ServiceProvider::class
// 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']);