Skip to content

Commit 8752732

Browse files
committed
Update the readme
1 parent 87ede83 commit 8752732

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed

readme.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,68 @@
33
A Laravel package for [opensoft/rollout](https://github.com/opensoft/rollout)
44

55
[![Build Status](https://travis-ci.org/Jaspaul/laravel-rollout.svg?branch=master)](https://travis-ci.org/Jaspaul/laravel-rollout) [![Coverage Status](https://coveralls.io/repos/github/Jaspaul/laravel-rollout/badge.svg?branch=master)](https://coveralls.io/github/Jaspaul/laravel-rollout?branch=master) [![Code Climate](https://codeclimate.com/github/Jaspaul/laravel-rollout/badges/gpa.svg)](https://codeclimate.com/github/Jaspaul/laravel-rollout)
6+
7+
## Installation
8+
9+
### Composer
10+
11+
```sh
12+
composer require jaspaul/laravel-rollout
13+
```
14+
15+
### Setting up a Cache
16+
17+
Be sure to [enable the cache](https://laravel.com/docs/5.4/cache) for your Laravel application. This package uses the cache to store the rollout settings.
18+
19+
### Configuring the Service Provider
20+
21+
Open config/app.php and register the required service provider above your application providers.
22+
23+
```php
24+
'providers' => [
25+
...
26+
Jaspaul\LaravelRollout\ServiceProvider::class
27+
...
28+
]
29+
```
30+
31+
### Implementing Interfaces
32+
33+
Your rollout users must implement the `\Jaspaul\LaravelRollout\Helpers\User` interface. Often this will be your main user object:
34+
35+
```php
36+
<?php
37+
38+
use Jaspaul\LaravelRollout\Helpers\User as Contract;
39+
40+
class User implements Contract
41+
{
42+
/**
43+
* @return string
44+
*/
45+
public function getRolloutIdentifier()
46+
{
47+
return $this->id;
48+
}
49+
}
50+
```
51+
52+
## Commands
53+
54+
### List
55+
56+
`php artisan rollout:list`
57+
58+
![](https://cloud.githubusercontent.com/assets/2836589/24476459/4773446c-14a1-11e7-8ea5-132fe747e0ac.png)
59+
60+
### Create
61+
62+
`php artisan rollout:create {feature}`
63+
64+
Swap `{feature}` with the name of the feature you'd like to create a feature flag for.
65+
66+
### Add User
67+
68+
`php artisan rollout:add-user {feature} {user}`
69+
70+
Swap `{feature}` with the name of the feature, and `{user}` with a unique identifier for the user in your system.

0 commit comments

Comments
 (0)