*/ public function toArray(Request $request): array { return [ 'id' => $this->id, 'title' => $this->title, 'description' => $this->description, 'image' => asset('storage/'.$this->image), 'link' => $this->link !== null ? URL::signedRoute('redirect', $this->id) : null, 'category' => $this->whenLoaded('category'), 'broker' => new UserResource($this->whenLoaded('broker')), 'total_likes' => $this->total_likes, 'total_redirection' => $this->total_redirection, ]; } }