Esempio n. 1
0
 /**
  * @param $id
  * @return \Illuminate\Http\JsonResponse
  */
 public function show($id)
 {
     try {
         $profile = (array) $this->profiler->getProfile($id);
         if (!is_array($profile) || count($profile) === 0) {
             return response()->json(['error' => 'Profile not found'], 404);
         }
         return response()->json($profile);
     } catch (\Exception $e) {
         return response()->json(['error' => $e->getMessage()], 500);
     }
 }
Esempio n. 2
0
 /**
  * @param $id
  * @return string
  */
 public function show($id)
 {
     $profile = $this->objectToArray($this->profiler->getProfile($id));
     $renderer = new BarRenderer($profile, $this->profiler);
     return $renderer->content();
 }