我正在Windows环境下开发一个Laravel(5.2.29)项目,并在Chrome浏览器上进行测试.

I have made some changes on a Blade file using atom text editor and then refreshed my page and noticed that suddenly it has stopped reflecting the changes (it's loading the old Blade file).

I've tried the following:

  • Restarted the browser
  • 清除浏览器缓存
  • php artisan cache:clear
  • composer dumpautoload
  • 删除Blade 文件(出现view not found错误).然后创建了一个新的同名Blade 文件,没有任何内容,并刷新了页面.

无论如何,浏览器上显示的代码始终是相同的(旧)版本,而不是Blade 文件的内容.

How can I solve this issue?

推荐答案

为了避免每次重新加载时解析Blade 文件,Laravel会在处理Blade 后缓存视图.我遇到过一些情况,源(视图文件)被更新,但缓存文件没有"重新加载".在这些情况下,只需删除缓存的视图并重新加载页面.

The cached view files are stored in storage/framework/views.

Laravel相关问答推荐

Laravel中的HTTP请求如何工作?

Laravel带S3存储器

如何使用 Laravel 进行继承

调用字符串上的成员函数

try 发布 AJAX 请求时 POST 405(方法不允许)-Laravel 4

Laravel Eloquent - 随叫随到的加密/解密数据

Lumen 中的自定义 404 页面

Lumen和 MongoDB?

在 Laravel 5 中添加新配置文件不起作用

Laravel 5.3 创建模型返回字段没有默认值

Laravel Artisan Scheduler 中的链式命令?

不支持驱动Driver[] - Laravel 5.3

如何在新安装时指定 Lumen(或 Laravel)版本?

Laravel 迁移命名约定

在 Laravel 测试用例中模拟一个 http 请求并解析路由参数

Laravel 验证:数字和整数之间的区别?

如何在 Laravel 5.2 中使用 OR 条件将多个参数传递给中间件

在 laravel 中删除排队的作业(job)

Laravel 4 简单路由无法使用 mod_rewrite 和 .htaccess

你如何在 Laravel 5.3 的新通知服务生成的Electron邮件中添加图像?