In Laravel it can be done as simply as it is described here: https://laravel.com/docs/5.6/eloquent-resources.
Some says, API Resources is not meant for Lumen. However, just for the sake of this question, I want to know, strictly, if there is a way on how to add Laravel JSON API Resource in a Lumen project (the package use Illuminate\Http\Resources\Json\JsonResource;
is missing from freshly created Lumen project).