public function show($id)
    {
        $filters = [];
//        // handle permission
//        $filters = $this->handlePermission(__FUNCTION__);

        // Create Response Model
        $response = new ResponseModel();

        // try to get data
        try {
            $response->setMessage($this->getTrans('show', 'successful'));

            // add filter to get desired record
            array_push($filters,
                [$this->model->getKeyName(), '=', $id]
            );
            $data = $this->model
                ->where($filters)
                ->get();
            $response->setData($data);

            // catch exception
        } catch (Exception $exception) {
            $response->setError($exception->getCode());
            $response->setMessage($this->getTrans('show', 'failed'));
            $response->setStatus(false);
            if (env('APP_DEBUG', false)) {
                $response->setData(collect($exception->getMessage()));
            }
        }
        return SmartResponse::response($response);
    }
public function show($id)
    {
        $filters = [];
//        // handle permission
//        $filters = $this->handlePermission(__FUNCTION__);

        // Create Response Model
        $response = new ResponseModel();

        // try to get data
        try {
            $response->setMessage($this->getTrans('show', 'successful'));

            // add filter to get desired record
            array_push($filters,
                [$this->model->getKeyName(), '=', $id]
            );
            $data = $this->model
                ->where($filters)
                ->get();
            $response->setData($data);

            // catch exception
        } catch (Exception $exception) {
            $response->setError($exception->getCode());
            $response->setMessage($this->getTrans('show', 'failed'));
            $response->setStatus(false);
            if (env('APP_DEBUG', false)) {
                $response->setData(collect($exception->getMessage()));
            }
        }
        return SmartResponse::response($response);
    }
public function show ( $ id ) { $ filters = [ ] ; //        // handle permission //        $filters = $this->handlePermission(__FUNCTION__); // Create Response Model $ response = new ResponseModel ( ) ; // try to get data try { $ response -> setMessage ( $ this -> getTrans ( 'show' , 'successful' ) ) ; // add filter to get desired record array_push ( $ filters , [ $ this -> model -> getKeyName ( ) , '=' , $ id ] ) ; $ data = $ this -> model -> where ( $ filters ) -> get ( ) ; $ response -> setData ( $ data ) ; // catch exception } catch ( Exception $ exception ) { $ response -> setError ( $ exception -> getCode ( ) ) ; $ response -> setMessage ( $ this -> getTrans ( 'show' , 'failed' ) ) ; $ response -> setStatus ( false ) ; if ( env ( 'APP_DEBUG' , false ) ) { $ response -> setData ( collect ( $ exception -> getMessage ( ) ) ) ; } } return SmartResponse :: response ( $ response ) ; }
Display the specdefaultied resource.

@param  int $id
@return \Illuminate\Http\JsonResponse
Display the specdefaultied resource .