ken4ward
269
5
Lumen

Object of class App\\Repository\\UserRepository could not be converted to string

Posted 2 months ago by ken4ward

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 sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.