I'm trying to switch from Laravel JsonResource to JsonApiResource and was under the impression that one could simply replace the JsonResource with JsonApiReource
"Declaration of App\Http\Resources\UserSignatureResource::toArray(Illuminate\Http\Request $request): array must be compatible with TiMacDonald\JsonApi\JsonApiResource::toArray($request)",
<?php
namespace App\Http\Resources;
use Illuminate\Http\Request;
use TiMacDonald\JsonApi\JsonApiResource;
/** @mixin \App\Models\UserSignature */
class UserSignatureResource extends JsonApiResource
{
public function toArray(Request $request): array
{
return [
'id' => $this->id,
'name' => $this->name,
'signature' => $this->signature,
'user_id' => $this->user_id,
];
}
}
Hi
I'm trying to switch from Laravel JsonResource to JsonApiResource and was under the impression that one could simply replace the JsonResource with JsonApiReource
"Declaration of App\Http\Resources\UserSignatureResource::toArray(Illuminate\Http\Request $request): array must be compatible with TiMacDonald\JsonApi\JsonApiResource::toArray($request)",