*/ 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')), 'totalLikes' => $this->total_likes, 'totalRedirection' => $this->total_redirection, 'isLiked' => $this->is_liked, 'isFavorite' => $this->is_favorite, ]; } }