LoginSignup
0

More than 5 years have passed since last update.

Laravel5系blade中でassetファイルのlastModified追加

Last updated at Posted at 2017-04-24

タイトルまんまですがmix(elixir)などでapp.cssやapp.jsを更新してもデフォルトのテンプレートではキャッシュを読んでしまったりします。

<link href="{{ asset('css/app.css') }}?ver={{ File::lastModified('css/app.css') }}" rel="stylesheet">
<script src="{{ asset('js/app.js') }}?ver={{ File::lastModified('js/app.js') }}"></script>

ファサードが使えることが前提だしもっといい他の方法があるのかもしれないですがとりあえずこれで解決してます。

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0