P1llus
2375
11
Laravel

Changing blade files never change when refreshing/clearing cache

Posted 3 years ago by P1llus

Hello everyone,

I seem to have some some troubles with changing blade files, and first i thought it was my own browser caching, or i have enabled caching for some reason on my server, but i have already tested these things:

Clearing browser cache

Checking with a new browser

Using artisan to clear cache.

Set cache option in env file.

Change cache option in php.ini.

Reboot server.

And STILL it is showing the older pages, even after editing them.

Here is the codes:

routes.php

Route::get('articles', 'ArticlesController@index');

Controller:

<?php

namespace App\Http\Controllers;

use App\Article;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Http\Controllers\Controller;

class ArticlesController extends Controller
{
    public function index()
    {
        $articles = Article::all();

        return view('articles.index', compact('articles'));
    }

    public function show($id)
    {
        $article = Article::findOrFail($id);



        return view('articles.show', compact('article'));
    }
}

And the view (master and specifc view):

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
</head>
<body>
    <div class="container">
        @yield('content')
    </div>

    <div>
        @yield('footer')

    </div>


</body>
</html>
@extends('app')

@section('content')
    <h1>asd</h1>

    </hr>
    @foreach ($articles as $article)
        <article>
            <h2>
                {{ $article->title  }}
            </h2>

            <div class="body">{{ $article->body  }}</div>
        </article>
    @endforeach
@stop

Now for example, if i change the h1 title in my index.blade.php it will still show the old title. If i remove the foreach and just put in random html, it still shows old content. Only when i change the controller to return something other than the view, just text for exmple, the browser is updated with the new content.

I really hope someone got any pointers to me on what to look for here! :)

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.