protected function getFileContentType($file) { $array = explode('.', $file); $ext = end($array); $contentTypes = ['css' => 'text/css', 'js' => 'text/javascript', 'svg' => 'image/svg+xml', 'map' => 'text/css', 'woff' => 'application/x-font-woff', 'woff2' => 'application/x-font-woff2']; return $contentTypes[$ext]; }