Display the specified resource.

@param  \Illuminate\Http\Request  $request
@param  int  $id
@return \Illuminate\Http\Response
555956
public function show(Request $request, $id)
    {
        try{
            $tag = $request->user()->tags()->where('id', $id)->firstOrFail();
            $results = fractal()->item($tag, new TagTransformer());
            return response()->json($results);
        }catch (\Exception $e){
            return response()->json([ 'error' => 404, 'message' => 'Not found' ], 404);
        }

    }
1126790
public function show(Request $request, $key)
    {
        $model = $this->findFirstByKey($key);

        if (!$model) {
            if ($request->wantsJson()) {
                return $this->validNotFoundJsonResponse();
            }
            abort(404);
        }

        if ($request->wantsJson()) {
            return response()->json($model, 200, [], JSON_PRETTY_PRINT);
        }

        $view = $this->getViewLocation(__FUNCTION__);
        $this->checkViewExists($view);

        return response()->view($view, compact('model'));
    }
221266
public function fetch($id, Request $request)
    {
        $post = $this->model()->find($id);

        if (is_null($post) || !$post->exists) {
            return $this->notFoundResponse();
        }

        return $this->response($post);
    }
1116172
public function show($id, ShowRequest $request)
    {
        $permission = $this->repository->findWithoutFail($id);
        $permission->load($request->getWith());

        if (empty($permission)) {
            return $this->sendError('Permission not found');
        }

        return $this->sendResponse($permission, '');
    }
746442
public function show($id)
    {
        $data = $this->service->show($id);

        return $this->success($data);
    }
995969
public function show(Request $request, $id)
    {
        $menuItem = Menu::where('id', $id)->first();

        return $this->response()->item($menuItem, new NodeTransformer());
    }
172011
public function show($id)
    {
        // get permission by id
        $permission = Permission::find($id);

        if (!$permission) {
            return response()->json(null, 404);
        }

        return response()->json(arrayView('phpsoft.users::permission/read', [
            'permission' => $permission
        ]), 200);
    }
783275
public function show($id, ShowRequest $request)
    {
        $upload = $this->repository->find($id);
        $upload->load($request->getWith());

        if (empty($upload)) {
            return $this->sendError('Upload not found');
        }

        return $this->sendResponse($upload, '');
    }
647988
public function show($id, Request $request)
    {
        $entity = $this->getEntityById($id);

        if (!$entity) {
            return $this->response(null, Response::HTTP_NOT_FOUND);
        }

        return $this->response($this->serialize($entity, $request), Response::HTTP_OK);
    }
126165
public function getAction($id, Request $request)
    {
        try {
            $locale = $this->getRequestParameter($request, 'locale', true);
            $mediaManager = $this->getMediaManager();
            $view = $this->responseGetById(
                $id,
                function($id) use ($locale, $mediaManager) {
                    $media = $mediaManager->getById($id, $locale);
                    $collection = $media->getEntity()->getCollection();

                    if (SystemCollectionManagerInterface::COLLECTION_TYPE === $collection->getType()->getKey()) {
                        $this->getSecurityChecker()->checkPermission(
                            'sulu.media.system_collections',
                            PermissionTypes::VIEW
                        );
                    }

                    $this->getSecurityChecker()->checkPermission(
                        new SecurityCondition(
                            $this->getSecurityContext(),
                            $locale,
                            $this->getSecuredClass(),
                            $collection->getId()
                        ),
                        PermissionTypes::VIEW
                    );

                    return $media;
                }
            );
        } catch (MediaNotFoundException $e) {
            $view = $this->view($e->toArray(), 404);
        } catch (MediaException $e) {
            $view = $this->view($e->toArray(), 400);
        }

        return $this->handleView($view);
    }
406342
public function show($id, ShowRequest $request)
    {
        $activityLog = $this->repository->findWithoutFail($id);
        if (empty($activityLog)) {
            return $this->sendError('ActivityLog not found');
        }
        $activityLog->load($request->getWith());

        return $this->sendResponse($activityLog, '');
    }
590932
public function show($id, ShowRequest $request)
    {
        $role = $this->repository->findWithoutFail($id);
        $role->load($request->getWith());

        if (empty($role)) {
            return $this->sendError('Role not found');
        }

        return $this->sendResponse($role, '');
    }
853254
public function viewAction(Request $request, $id)
    {
        $em = $this->getDoctrine()->getManager();

        /** @var $file \Orkestra\Bundle\ApplicationBundle\Entity\File */
        $file = $em->find('Orkestra\Bundle\ApplicationBundle\Entity\File', $id);

        if (!$file || !file_exists($file->getPath())) {
            throw $this->createNotFoundException('Unable to locate File');
        }

        $securityContext = $this->get('security.context');

        foreach ($file->getGroups() as $group) {
            if (!$securityContext->isGranted($group->getRole())) {
                throw $this->createNotFoundException('Unable to locate File');
            }
        }

        $response = new Response();
        $response->setLastModified(new \DateTime('@' . filemtime($file->getPath())));
        $response->setPublic();
        if (($hash = $file->getMd5()) !== '') {
            $response->setEtag($hash);
        }

        if ($response->isNotModified($request)) {
            return $response;
        }

        $response->setContent($file->getContent());
        $response->headers->add(array(
            'Content-Type' => $file->getMimeType(),
        ));

        return $response;
    }
1370484
public function update(Request $request, $id)
    {
        $response = $this->repository->update($id, $request->all());
        return Response::apiResponse([
            'data' => $response
        ]);

    }
990879
public function getAction(Request $request, $id)
    {
        $locale = $this->getProductLocaleManager()->retrieveLocale($this->getUser(), $request->get('locale'));
        $view = $this->responseGetById(
            $id,
            function ($id) use ($locale) {
                /** @var Product $product */
                $product = $this->getManager()->findByIdAndLocale($id, $locale);

                return $product;
            }
        );

        return $this->handleView($view);
    }
970255
public function fetch($id, Request $request)
    {
        $thread = $this->model();
        $thread = $request->input('include_deleted') ? $thread->withTrashed()->find($id) : $thread->find($id);

        if (is_null($thread) || !$thread->exists) {
            return $this->notFoundResponse();
        }

        if ($thread->trashed()) {
            $this->authorize('delete', $thread);
        }

        if ($thread->category->private) {
            $this->authorize('view', $thread->category);
        }

        return $this->response($thread);
    }
420406
public function getAction(Request $request, $id = null)
    {
        $locale = $this->getLocale($request);

        $snippet = $this->findDocument($id, $locale);
        $view = View::create($snippet);

        return $this->viewHandler->handle($view);
    }