我一直在我的Vagrant开发环境中工作,Laravel 5应用程序运行正常。当我将应用程序上传到我的DO Ubuntu 14.14 Droplet时,它从缓存加载View,当我更新视图刀片模板时,它不会影响网站。
我已经搜索了解决方案,但没有找到任何结果。现在确定如何停止缓存视图或刷新缓存。
错误:
ErrorException in 61093154cb848bf7f33155b09ac70c93 line 132: Undefined property: Illuminate\Database\Eloquent\Collection::$profile_picture (View: /var/www/demo/property/public/resources/views/user/account/acc.blade.php)
in 61093154cb848bf7f33155b09ac70c93 line 132
at CompilerEngine->handleViewException(object(ErrorException), '1') in PhpEngine.php line 43
at PhpEngine->evaluatePath('/var/www/demo/property/public/storage/framework/views/61093154cb848bf7f33155b09ac70c93', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'page_title' => 'User Account', 'profile' => object(Collection))) in CompilerEngine.php line 57
at CompilerEngine->get('/var/www/demo/property/public/resources/views/user/account/acc.blade.php', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'page_title' => 'User Account', 'profile' => object(Collection))) in View.php line 136
at View->getContents() in View.php line 104
at View->renderContents() in View.php line 78
at View->render() in Response.php line 44
at Response->setContent(object(View)) in Response.php line 202
at Response->__construct(object(View)) in Router.php line 1198
at Router->prepareResponse(object(Request), object(View)) in Router.php line 702
at Router->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 141
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Authenticate.php line 47
at Authenticate->handle(object(Request), object(Closure)) in Pipeline.php line 125
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 101
at Pipeline->then(object(Closure)) in Router.php line 703
at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 670
at Router->dispatchToRoute(object(Request)) in Router.php line 628
at Router->dispatch(object(Request)) in Kernel.php line 214
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 141
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in VerifyCsrfToken.php line 43
at VerifyCsrfToken->handle(object(Request), object(Closure)) in VerifyCsrfToken.php line 17
at VerifyCsrfToken->handle(object(Request), object(Closure)) in Pipeline.php line 125
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in ShareErrorsFromSession.php line 55
at ShareErrorsFromSession->handle(object(Request), object(Closure)) in Pipeline.php line 125
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in StartSession.php line 61
at StartSession->handle(object(Request), object(Closure)) in Pipeline.php line 125
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 36
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure)) in Pipeline.php line 125
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in EncryptCookies.php line 40
at EncryptCookies->handle(object(Request), object(Closure)) in Pipeline.php line 125
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in CheckForMaintenanceMode.php line 42
at CheckForMaintenanceMode->handle(object(Request), object(Closure)) in Pipeline.php line 125
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 101
at Pipeline->then(object(Closure)) in Kernel.php line 115
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 84
at Kernel->handle(object(Request)) in index.php line 53
错误发生后,我已更新第132行,但不影响。我尝试删除acc.blade.php文件中的所有内容,但仍然收到错误。
答案 0 :(得分:1)
我制作了一个用于清除视图的程序包(artisan命令),因为手动清除它们确实很烦人。
https://github.com/Kyslik/view-clear
仅安装$ php artisan view:clear
也许浏览器本身正在做一些缓存,所以使用" hard reload"或者"硬刷新"在Windows上使用ctrl + f5(ctrl + r)或在osx上使用shift + command + r。