Skip to content

Commit

Permalink
Update readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
overtrue committed Nov 11, 2016
1 parent ed00c6e commit 655a104
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,25 @@

You can install the package using composer

```
```sh
$ composer require overtrue/follow -vvv
```

Then add the service provider to `config/app.php`

```
```php
Overtrue\LaravelFollow\FollowServiceProvider::class
```

Publish the migrations file:

```
```sh
$ php artisan vendor:publish --provider="Overtrue\LaravelFollow\FollowServiceProvider" --tag="migrations"
```

Finally, use FollowTrait in User model

```
```php
use Overtrue\LaravelFollow\FollowTrait;

class User extends Model
Expand All @@ -36,24 +36,28 @@ class User extends Model
## Usage

### Follow User
```

```php
$user->follow(1)
$user->follow([1,2,3,4])
```

### Unfollow User
```

```php
$user->unfollow(1)
$user->unfollow([1,2,3,4])
```

### Get Followers
```

```php
$user->followers()
```

### Get Followings
```

```php
$user->followings()
```

Expand All @@ -63,13 +67,11 @@ $user->isFollowing(1)
```

### Check if Followed By
```

```php
$user->isFollowedBy(1)
```

## Testing
You can run test by just performing `phpunit` command

## License

MIT

0 comments on commit 655a104

Please sign in to comment.