×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: Marcelo Aleks
Added: May 17, 2015 9:36 PM
Views: 3
Tags: no tags
  1. function asset_timed($path, $secure=null){
  2.     $file = public_path($path);
  3.     if(file_exists($file)){
  4.         return asset($path, $secure) . '?' . filemtime($file);
  5.     }else{
  6.         throw new \Exception('The file "'.$path.'" cannot be found in the public folder');
  7.     }
  8. }
  9.  
  10. <link rel="stylesheet" type="text/css" href="{{ asset_timed('assets/css/style.css') }}" />