Skip to content

Commit 9cac26b

Browse files
committed
Update REAMDE.md, make document consistence with generated Repository
- Update repository NOTE
1 parent 1136ecd commit 9cac26b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,19 +93,21 @@ use PPSpaces\Repositories\Model as Repository;
9393

9494
class UserRepository extends Repository {
9595

96+
protected $user;
97+
9698
public function __construct(User $user) {
97-
$this->model = $user;
99+
$this->user = $user;
98100
}
99101

100102
public function all($columns = ['*']) {
101-
return $this->model
103+
return $this->user
102104
->role('staff')
103105
->paginate();
104106
}
105107
}
106108
```
107109

108-
> NOTE: Check `PPSpaces\Repositories\Model` for available methods that you may override.
110+
> NOTE: Check `PPSpaces\Repositories\Model` for available methods that you may override. Keep in mind that you still have access to all Model instance that you've created. The `$this->user` is the instance of your `\App\User` model.
109111
110112
Within your `UserController` assume you have a resource controller created. Inject the `UserRepository` to the contoller.
111113

0 commit comments

Comments
 (0)