Level 60
$this->$userRepository
Unnecessary dollar sign, this is first what I see
3 likes
I am presently using the repository but kept getting the error
UserRepository class
{
$users = User::all();
return $users;
}```
Object of class App\Repository\UserRepository could not be converted to string.
THis is the controller class
```public function show()
{
$user = $this->$userRepository->getAll();
$response = $this->response->item($user, new UserTransformer());
}```
Kindly help.
Please or to participate in this conversation.