Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel Blade views not showing the changes made to them

System Details : Using WAMP2.5 in Windows 64 bit
MYSQL:5.6.17
PHP:5.5.12
Apache :2.4.9
I installed laravel via composer installation . It was all fine since recently all my views stopped showing any changes made to them . This is happening to views which use Blade template only.

I have created the blade files correctly and named them with filename.blade.php. My view File Structure -
views
        -layouts
                   defaults.blade.php
        show.blade.php
        login.blade.php
       

defaults.blade.php

<!DOCTYPE html>  
<html>
      <head></head>
<body>
  <div>
   <nav></nav>

       @yield('content')

  </div>
      @yield('footerscripts')

</body>
</html>

show.blade.php

@extends('layouts.defaults')
@section('content')
    --- SOME CONTENT ---
@stop

@section('footerscripts')
     --- js scripts ---
@stop

The same format was working perfectly but suddenly started acting strangely.Even after refreshing many times the view doesn't change,Once i tried deleting everything inside the view page still it showed up in the browser.
There are similar question but many didn't have accepted answer and the one with some ratings didn't worked for me . I also tried re-installing fresh new WAMP copy but no Help.It only works if i change its name but if i change it back to the original one it again starts showing the old version of it. Only happens with blade templating.

like image 797
Vishal Nair Avatar asked Jul 02 '14 19:07

Vishal Nair


3 Answers

If you use PhpStorm:

  1. open menu File → Settings

  2. go to Deployment → Options section

  3. then uncheck Preserve files timestamps option

like image 160
Arthur Shlain Avatar answered Sep 21 '22 11:09

Arthur Shlain


I'm not sure of the specifics, but this is related to how filemtime() is implemented in windows (possibly related bug here).

Illuminate\View\Compilers\BladeCompiler (well, it's parent class, Compiler) checks to see if a file has changed since last compilation by checking it's mtime, through Illuminate\Filesystem\Filesystem which calls calls filemtime() (see L179-188). Evidently this is failing to report properly on your system.

First, ensure that the app/storage/views directory has read, write and delete permissions. If this doesn't help, the simplest solution would be to clear the app/storage/views/ directory whenever making a change.

like image 44
clarkf Avatar answered Sep 19 '22 11:09

clarkf


I had this same issue , reason was I am doing uploads remote, but the time on my computer was different than what that was on my server

like image 28
LukePOLO Avatar answered Sep 21 '22 11:09

LukePOLO