PHP Classes

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

Recommend this page to a friend!
  Classes of Shun Ram   Laravel Admin   src/stubs/cms/core/layout/routes.php   Download  
File: src/stubs/cms/core/layout/routes.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Laravel Admin
Manage users and the site content they publish
Author: By
Last change:
Date: 1 year ago
Size: 706 bytes
 

 

Contents

Class file image Download
<?php
Route
::get('/',function(){
    return
view('layout::site.welcome');
})->
name('home');
/*assets*/
Route::get('/assets/{module}/{type}/{file}', [ function ($module, $type, $file) {
   
$module = ucfirst($module);

   
$path = base_path("cms/local/".Cms::getCurrentTheme()."/$module/resources/assets/$type/$file");

    if (\
File::exists($path)) {
       
//return response()->download($path, "$file");
       
if($type == 'js'){
            return
response()->file($path, array('Content-Type' => 'application/javascript'));
        }else{
            return
response()->file($path, array('Content-Type' => 'text/css'));
        }
    }

    return
response()->json([ ], 404);
}]);