lumen 使用 laravel-cors 的时候, 使用 dd 函数的解决方法

if (! function_exists('dd')) {
    /**
     * Dump the passed variables and end the script.
     *
     * @param  mixed  $args
     * @return void
     */
    function dd(...$args)
    {
        header('Access-Control-Allow-Origin: *');
        header('Access-Control-Allow-Methods: *');
        header('Access-Control-Allow-Headers: *');
        http_response_code(500);

        foreach ($args as $x) {
            (new IlluminateSupportDebugDumper)->dump($x);
        }

        die(1);
    }
}

  

原文地址:https://www.cnblogs.com/eleven24/p/10121966.html