Skip to content

Commit ff309de

Browse files
committed
updated readme. lowered dependancies.
1 parent 4b3e2cd commit ff309de

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

README.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# laravel-validator-color
1+
# Validate colors with Laravel 5
22
[![Latest Version](https://img.shields.io/github/release/zenapply/laravel-validator-color.svg?style=flat-square)](https://github.com/zenapply/laravel-validator-color/releases)
33
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)
44
[![Build Status](https://travis-ci.org/zenapply/laravel-validator-color.svg?branch=master)](https://travis-ci.org/zenapply/laravel-validator-color)
@@ -7,6 +7,8 @@
77
[![Dependency Status](https://www.versioneye.com/user/projects/56f3252c35630e0029db0187/badge.svg?style=flat)](https://www.versioneye.com/user/projects/56f3252c35630e0029db0187)
88
[![Total Downloads](https://img.shields.io/packagist/dt/zenapply/laravel-validator-color.svg?style=flat-square)](https://packagist.org/packages/zenapply/laravel-validator-color)
99

10+
This package will let you validate that a certain value is a valid CSS color string.
11+
1012
## Installation
1113

1214
Install via [composer](https://getcomposer.org/) - In the terminal:
@@ -17,4 +19,22 @@ composer require zenapply/laravel-validator-color
1719
Now add the following to the `providers` array in your `config/app.php`
1820
```php
1921
Zenapply\Validator\Providers\ColorValidatorServiceProvider::class
20-
```
22+
```
23+
24+
## Usage
25+
26+
```php
27+
// Test any color type
28+
Validator::make(['test' => '#454ACF'], ['test' => 'color']);
29+
30+
// Test for rgb
31+
Validator::make(['test' => 'rgb(0, 200, 150)'], ['test' => 'color_rgb']);
32+
33+
// Test for rgba
34+
Validator::make(['test' => 'rgba(0, 200, 150, 0.52)'], ['test' => 'color_rgba']);
35+
36+
// Test for hex
37+
Validator::make(['test' => '#333'], ['test' => 'color_hex']);
38+
39+
// Test for css color keyword
40+
Validator::make(['test' => 'gold'], ['test' => 'color_keyword']);

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
},
2929
"minimum-stability": "stable",
3030
"require": {
31-
"illuminate/validation": "^5.2",
32-
"illuminate/support": "^5.2",
31+
"illuminate/validation": "^5.0",
32+
"illuminate/support": "^5.0",
3333
"php": "^5.5.9|^7.0"
3434
},
3535
"require-dev": {

0 commit comments

Comments
 (0)