Skip to content
This repository was archived by the owner on Sep 13, 2024. It is now read-only.

Commit 566884b

Browse files
committed
Project structure
0 parents  commit 566884b

File tree

9 files changed

+154
-0
lines changed

9 files changed

+154
-0
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/examples export-ignore

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
*.lock
2+
package.xml
3+
/vendor
4+
.idea
5+
.php_cs.cache
6+
docs/_build
7+
/.vagrant

CHANGES.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Changes History
2+
3+
1.0.0
4+
-----
5+
6+
- Initial version:
7+
HasRole trait, ServiceProvider

LICENSE

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2016 Saritasa
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in
11+
all copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
16+
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19+
SOFTWARE.

README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Fluid Validation Rules builders for Laravel
2+
3+
Use fluid-style syntax to build Laravel validation rules
4+
5+
## Usage
6+
7+
Install the ```saritasa/laravel-fluid-validation``` package:
8+
9+
```bash
10+
$ composer require saritasa/laravel-fluid-validation
11+
```
12+
13+
**Example**:
14+
```php
15+
$rules = [
16+
'id' => Rule::int()->required(),
17+
'name' => Rule::string()->required()->minLength(3),
18+
'email' => Rule::string()->required()->email()
19+
]
20+
```
21+
22+
## Advantages
23+
* Strong typing
24+
* Intellisence for available rules and parameters (if you use smart IDE, like PHPStorm)
25+
* Hints about mistypings (if you use smart IDE, like PHPStorm)
26+
27+
## Available classes
28+
29+
### Rules
30+
Root of your rule builder.
31+
32+
## Contributing
33+
34+
1. Create fork
35+
2. Checkout fork
36+
3. Develop locally as usual. **Code must follow [PSR-1](http://www.php-fig.org/psr/psr-1/), [PSR-2](http://www.php-fig.org/psr/psr-2/)**
37+
4. Update [README.md](README.md) to describe new or changed functionality. Add changes description to [CHANGES.md](CHANGES.md) file.
38+
5. When ready, create pull request
39+
40+
## Resources
41+
42+
* [Bug Tracker](http://github.com/saritasa/php-roles-simple/issues)
43+
* [Code](http://github.com/saritasa/php-roles-simple)
44+
* [Changes History](CHANGES.md)
45+
* [Authors](http://github.com/saritasa/php-roles-simple/contributors)

composer.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"name": "saritasa/php-laravel-fluid-validation",
3+
"type": "library",
4+
"description": "Set of fluid builders for Laravel request validation rules",
5+
"keywords": ["laravel", "validation"],
6+
"license": "MIT",
7+
"authors": [
8+
{
9+
"name": "Sergey Populov",
10+
"email": "sergey@saritasa.com"
11+
}
12+
],
13+
"require": {
14+
"php": ">=7.0",
15+
"illuminate/database": "^5.4",
16+
"illuminate/support": "^5.4"
17+
},
18+
"require-dev": {
19+
"phpunit/phpunit": "^6.0"
20+
},
21+
"minimum-stability": "stable",
22+
"autoload": {
23+
"psr-4" : {
24+
"Saritasa\\Laravel\\Validation": "src/"
25+
}
26+
},
27+
"config": {
28+
"preferred-install": "dist",
29+
"sort-packages": true
30+
},
31+
"extra": {
32+
"branch-alias": {
33+
"dev-master": "1.0.x-dev"
34+
}
35+
}
36+
}

phpunit.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<phpunit backupStaticAttributes="false"
4+
colors="true"
5+
convertErrorsToExceptions="true"
6+
convertNoticesToExceptions="true"
7+
convertWarningsToExceptions="true"
8+
processIsolation="false"
9+
stopOnFailure="false"
10+
syntaxCheck="false"
11+
bootstrap="test/bootstrap.php"
12+
>
13+
<testsuites>
14+
<testsuite name="Saritasa Roles Test Suite">
15+
<directory>./tests/</directory>
16+
</testsuite>
17+
</testsuites>
18+
19+
<filter>
20+
<whitelist>
21+
<directory suffix=".php">./src/</directory>
22+
</whitelist>
23+
</filter>
24+
</phpunit>

provides.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"providers": [
3+
],
4+
"aliases": [
5+
{
6+
}
7+
]
8+
}

src/Rule.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
namespace Saritasa\Laravel\Validation;
4+
5+
class Rule
6+
{
7+
}

0 commit comments

Comments
 (0)