Laravel Blade views not showing the changes made to them

12,397

Solution 1

If you use PhpStorm:

  1. open menu File → Settings

  2. go to Deployment → Options section

  3. then uncheck Preserve files timestamps option

Solution 2

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.

Solution 3

I got very easy solution, I was having same project in two folders, I was editing one and php artisan was running on other, when get to that project where php server was running in it and made changes it worked.

Solution 4

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

Share:
12,397
Vishal Nair
Author by

Vishal Nair

I am from Pune, India. Currently working in Dubai. Some of my main technology interests are Spring, Angular, Microservices and recently BlockChain. LinkedIn : https://www.linkedin.com/in/vishal-nair/ Twitter : https://twitter.com/vish_tweets

Updated on August 03, 2022

Comments

  • Vishal Nair
    Vishal Nair over 1 year

    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.