Skip to content

Commit 84d1699

Browse files
authored
Update routes.php
1 parent 062a919 commit 84d1699

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

src/stubs/cms/core/layout/routes.php

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,21 @@
11
<?php
22
Route::get('/',function(){
33
return view('layout::site.welcome');
4-
})->name('home');
4+
})->name('home');
5+
/*assets*/
6+
Route::get('/assets/{module}/{type}/{file}', [ function ($module, $type, $file) {
7+
$module = ucfirst($module);
8+
9+
$path = base_path("cms/local/".Cms::getCurrentTheme()."/$module/resources/asserts/$type/$file");
10+
11+
if (\File::exists($path)) {
12+
//return response()->download($path, "$file");
13+
if($type == 'js'){
14+
return response()->file($path, array('Content-Type' => 'application/javascript'));
15+
}else{
16+
return response()->file($path, array('Content-Type' => 'text/css'));
17+
}
18+
}
19+
20+
return response()->json([ ], 404);
21+
}]);

0 commit comments

Comments
 (0)