protected function notFoundResponse()
    {
        $content = ['error' => "Resource not found."];

        return (request()->ajax() || request()->wantsJson())
            ? new JsonResponse($content, 404)
            : new Response($content, 404);
    }
protected function notFoundResponse()
    {
        $content = ['error' => "Resource not found."];

        return (request()->ajax() || request()->wantsJson())
            ? new JsonResponse($content, 404)
            : new Response($content, 404);
    }
protected function notFoundResponse ( ) { $ content = [ 'error' => "Resource not found." ] ; return ( request ( ) -> ajax ( ) || request ( ) -> wantsJson ( ) ) ? new JsonResponse ( $ content , 404 ) : new Response ( $ content , 404 ) ; }
Create a 'not found' response.

@return JsonResponse|Response
Create a not found response .