app/Http/Controllers/Traits/ResponseTrait.php
/**
     * Return single item response from the application
     *
     * @param Model $item
     * @param \Closure|TransformerAbstract $callback
     * @return \Illuminate\Http\JsonResponse
     */
Return single item response from the application
@param Model $item
@param \Closure|TransformerAbstract $callback
@return \Illuminate\Http\JsonResponse
Return single item response from the application @param Model $item @param \ Closure|TransformerAbstract $callback @return \ Illuminate \ Http \ JsonResponse
protected function respondWithItem($item, $callback, $included=null)
    {
        $resource = new Item($item, $callback);
        $trans = $this->fractal;
        if($included != null){
            $trans->parseIncludes($included);
        }
        $rootScope = $trans->createData($resource);
        $data=['status'=>200,'message'=>'OK'] + $rootScope->toArray();
        return $this->respondWithArray($data);
    }
protected function respondWithItem ( $ item , $ callback , $ included = null ) { $ resource = new Item ( $ item , $ callback ) ; $ trans = $ this -> fractal ; if ( $ included != null ) { $ trans -> parseIncludes ( $ included ) ; } $ rootScope = $ trans -> createData ( $ resource ) ; $ data = [ 'status' => 200 , 'message' => 'OK' ] + $ rootScope -> toArray ( ) ; return $ this -> respondWithArray ( $ data ) ; }
Return single item response from the application
 @param Model $item
 @param \Closure|TransformerAbstract $callback
 @return \Illuminate\Http\JsonResponse
Return single item response from the application @param Model $item @param \ Closure|TransformerAbstract $callback @return \ Illuminate \ Http \ JsonResponse
// $this->fractal= new Manager();