service = $service; } /** * @param string $forum_slug * @return \Illuminate\Http\JsonResponse|mixed */ public function getUserProfile(string $forum_slug){ try{ $profile = $this->service->getUserProfile($forum_slug); return $this->ok($profile->serialize()); } catch (ValidationException $ex) { Log::warning($ex); return $this->error412([$ex->getMessage()]); } catch(EntityNotFoundException $ex) { Log::warning($ex); return $this->error404(['message'=> $ex->getMessage()]); } catch (\Exception $ex) { Log::error($ex); return $this->error500($ex); } } }