Asvae\ApiTester\Http\Controllers\AssetsController::file PHP Method

file() protected method

protected file ( $file, $root )
    protected function file($file, $root)
    {
        $contents = file_get_contents($root . DIRECTORY_SEPARATOR . $file);
        $response = response($contents, 200, ['Content-Type' => $this->getFileContentType($file)]);
        // Browser will cache files for 1 year.
        $secondsInYear = 60 * 60 * 24 * 365;
        $response->setSharedMaxAge($secondsInYear);
        $response->setMaxAge($secondsInYear);
        $response->setExpires(new DateTime('+1 year'));
        return $response;
    }