Skip to content

Commit 771011a

Browse files
committed
Merge branch 'develop'
2 parents b360ae0 + 9cac26b commit 771011a

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
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

src/Console/stubs/repository.model.stub

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ use PPSpaces\Repositories\Model as Repository;
88
class DummyClass extends Repository {
99

1010
/**
11-
* The model instance.
11+
* The DummyModelVariable model instance.
1212
*
13-
* @var string
13+
* @var \DummyFullModelClass
1414
*/
1515
protected $DummyModelVariable;
1616

0 commit comments

Comments
 (0)