notalentgeek's avatar

Why does class 'Illuminate\Http\Resources\Json\JsonResource' not found in a Lumen project and how can I add JSON Resource in Lumen project?

use Illuminate\Http\Resources\Json\ResourceCollection; works and can be retrieved inside a Lumen project. But, using use Illuminate\Http\Resources\Json\JsonResource; will return

Class 'Illuminate\Http\Resources\Json\JsonResource' not found`

So, how can I add JsonResource inside a Lumen project?

0 likes
2 replies
wilburpowery's avatar

I haven't really used Lumen before.

Have you one into your vendor folder and manually search that class, just for the sake of seeing it actually exists in your project.

notalentgeek's avatar
notalentgeek
OP
Best Answer
Level 1

I am stupid in 5.5 it is supposed to be use Illuminate\Http\Resources\Json\Resource; not use Illuminate\Http\Resources\Json\JsonResource;

Please or to participate in this conversation.