wordxpression's avatar

When trying to implement a REST API it seems not to work.

I'm trying to implement REST methods in an application. I used artisan to scaffold all classes and other components. When I try to implement the 'index' method in this way :

public function index() { return Log::all(); }

I get in Postman an empty array. []

When I ask the content of log via tinker, I get the full array of objects.

Has anyone an idea what I could be wrong or a suggestion how to debug it?

Thanks in advance.

Wilko

0 likes
2 replies
Sergiu17's avatar

Make sure you hit the right endpoint

1 like

Please or to participate in this conversation.