Lumen support?
Sephen opened this issue · comments
Does this library work with Laravel/lumen?
I'm getting all kinds of errors like:
Declaration of App\Http\Resources\TestResource::toAttributes($request) must be compatible with TiMacDonald\JsonApi\JsonApiResource::toAttributes(Illuminate\Http\Request $request): array in ...
Adding use Illuminate\Http\Request
and public function toAttributes(Request $request): array
Results in:
Target [Illuminate\Contracts\Routing\ResponseFactory] is not instantiable.
Solved bij adding:
$this->app->singleton(\Illuminate\Contracts\Routing\ResponseFactory::class, function() {
return new \Laravel\Lumen\Http\ResponseFactory();
});
in AppServiceProvider.php