1

For the past couple of days I have been trying to get into Laravel 5 blade system. Yet for some absurd reason I cannot get things to work. Here's how things look now:

UserController -> index

public function index()
{
    return view('app');
}

So obviously we are getting a view so I create a blade file in views called app.blade.php

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
</body>
</html>

Alright so we are all set so when I load the page all I get is "Document" in the title.

Here's the rub: if I change the title tag to something else like so:

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Application</title>
</head>
<body>

</body>
</html>

And reload the page one would expect to see the title change? Well guess what? Nope. That didn't happen. The original title "Document" is still there.

Someone want to tell me whats going on here and how to fix it?

Giacomo1968
  • 25,759
  • 11
  • 71
  • 103
Tomkarho
  • 1,789
  • 3
  • 19
  • 25

1 Answers1

1

Are you sure it's not just cached? Try this: go to your \storage\framework\views and delete everything except .gitignore file, and try again.

If laravel is caching your view, clearing the browser cache won't help you as the caching is done server-side.

If you are actually using laravel 5.1, you can type on your terminal php artisan view:clear

More info: laravel.com/docs/5.0/cache

Victor
  • 556
  • 1
  • 10
  • 23
  • 1
    Clearing the view cache worked but I have to do it every time I make changes to my template. Is this really how Laravel is supposed to work? Any way to disable that caching? – Tomkarho Aug 04 '15 at 19:14
  • @Tomkarho, does your application environment "production" or "local"? I think that that "production" should always try to use cache whereas "local" environment regenerate it every time. – pepper Aug 06 '15 at 06:32
  • This is more for anyone else stumbling on this issue but the reason for the reload of the cache was not in laravel but in php itself. Refer to the following question and Sethens answer http://stackoverflow.com/questions/20579182/laravel-and-view-caching-in-development-cant-see-changes-right-away – Tomkarho Aug 06 '15 at 17:15