/** * Returns a file in the assets directory * * @return \Illuminate\Support\Facades\Response */ public function file($path) { $file = Asset::getFullPath($path); if (Asset::isJavascript($path)) { return $this->javascript($path); } if (Asset::isStylesheet($path)) { return $this->stylesheet($path); } if (file_exists($file)) { return Response::download($file); } App::abort(404); }
/** * Returns a file in the assets directory * * @return \Illuminate\Support\Facades\Response */ public function file($path) { $absolutePath = Asset::isJavascript($path); if ($absolutePath) { return $this->javascript($absolutePath); } $absolutePath = Asset::isStylesheet($path); if ($absolutePath) { return $this->stylesheet($absolutePath); } $absolutePath = Asset::isFile($path); if ($absolutePath) { return new BinaryFileResponse($absolutePath, 200); } App::abort(404); }