Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transformer class not found #100

Closed
bradsapp opened this issue Feb 18, 2016 · 3 comments
Closed

Transformer class not found #100

bradsapp opened this issue Feb 18, 2016 · 3 comments

Comments

@bradsapp
Copy link

I'm working on the example from the documentation using Laravel 4.2 but I always get a BookTransformer class not found error. What am I missing from the documentation?

`use Chrisbjr\ApiGuard\ApiGuardController;

class BooksController extends ApiGuardController
{
public function all()
{
$books = Book::all();

    return $this->response->withCollection($books, new BookTransformer);
}`
@gholol
Copy link
Contributor

gholol commented Feb 19, 2016

I bet there's no BookTransformer class inside your project. You have to write your own transformers yourself. It's just an example.

http://fractal.thephpleague.com/transformers/

@chrisbjr
Copy link
Owner

@gholol is right - I'll make sure there is a bit of info and some links regarding transformers in the readme on the next releases.

@bradsapp
Copy link
Author

Thanks chrisbjr for the response and also gholol.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants