app/Http/Controllers/MediaFileController.php
private function httpStatusAsImage(int $status): ResponseInterface
    {
        $svg = '<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><rect width="100" height="100" fill="#F88" /><text x="5" y="55" font-family="Verdana" font-size="35">' . $status . '</text></svg>';

        // We can't use the actual status code, as browser's won't show images with 4xx/5xx
        return response($svg, StatusCodeInterface::STATUS_OK, [
            'Content-Type'   => 'image/svg+xml',
            'Content-Length' => strlen($svg),
        ]);
    }
private function httpStatusAsImage(int $status): ResponseInterface
    {
        $svg = '<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><rect width="100" height="100" fill="#F88" /><text x="5" y="55" font-family="Verdana" font-size="35">' . $status . '</text></svg>';

        // We can't use the actual status code, as browser's won't show images with 4xx/5xx
        return response($svg, StatusCodeInterface::STATUS_OK, [
            'Content-Type'   => 'image/svg+xml',
            'Content-Length' => strlen($svg),
        ]);
    }
private function httpStatusAsImage ( int $ status ) : ResponseInterface { $ svg = '<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><rect width="100" height="100" fill="#F88" /><text x="5" y="55" font-family="Verdana" font-size="35">' . $ status . '</text></svg>' ; // We can't use the actual status code, as browser's won't show images with 4xx/5xx return response ( $ svg , StatusCodeInterface :: STATUS_OK , [ 'Content-Type' => 'image/svg+xml' , 'Content-Length' => strlen ( $ svg ) , ] ) ; }
Send a dummy image, to replace one that could not be found or created.

@param int $status HTTP status code

@return ResponseInterface
Send a dummy image to replace one that could not be found or created .