src/Http/Controllers/Controller.php
public function error($message, $code = 500, $errors = null)
    {
        $data = [
            'message' => $message
        ];

        if (is_array($errors)) {
            $data['errors'] = $errors;
        }

        return Response::json($data, $code, [], JSON_PRETTY_PRINT);
    }
public function error($message, $code = 500, $errors = null)
    {
        $data = [
            'message' => $message
        ];

        if (is_array($errors)) {
            $data['errors'] = $errors;
        }

        return Response::json($data, $code, [], JSON_PRETTY_PRINT);
    }
This method returns json for an unsuccessful request.
The $errors parameter can be used to send back form validation.

@param $message
@param int $code
@param null $errors
@return \Symfony\Component\HttpFoundation\Response