Skip to content
This repository has been archived by the owner on Mar 19, 2023. It is now read-only.

Latest commit

 

History

History
29 lines (24 loc) · 955 Bytes

README.md

File metadata and controls

29 lines (24 loc) · 955 Bytes

Cachebusting package for Laravel 4

This package allows you to use cachebusting helpers for your images. This feature adds an timestamp (modified date) to the file. So the user always will have the latest version of the image. In your .blade files, use the cachebust() method at an imagepath.

Do not forget to add this in config/app.php under providers:

  	'CeesVanEgmond\Minify\MinifyServiceProvider',

Dont forget to add this in your public/.htaccess to make it work:

  
    RewriteCond %{REQUEST_FILENAME} !-f
	RewriteCond %{REQUEST_FILENAME} !-d
	RewriteRule ^(.+)\.(\d+)\.(js|css|png|jpg|gif)$ $1.$3 [L]
 
 

You may now use it like this:

  img src="{{ cachebust('images/image.png') }}">
 

Or with Blade templating:

  	{{ HTML::image( cachebust('images/image.png') ) }}
 

Is you have any questions, bugs of comments, mention it in this repository.