- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我收到以下错误,我不知道为什么 rememberForever 未定义。
以下是我看到的几个常见错误跟踪:
Error {#4701
#message: "Call to undefined method Illuminate\Support\Facades\Cache::rememberForever()"
#code: 0
#file: "D:\CustomDomains\HolidayBuilders\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php"
#line: 261
trace: {
D:\CustomDomains\HolidayBuilders\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php:261 {
Illuminate\Support\Facades\Facade::__callStatic($method, $args) …
›
› return $instance->$method(...$args);
› }
}
D:\CustomDomains\HolidayBuilders\app\Providers\ComposerServiceProvider.php:120 {
App\Providers\ComposerServiceProvider->App\Providers\{closure} …
› return Spotlight::where('homepage', true)->limit(3)->get();\r
› });\r
› \r
}
D:\CustomDomains\HolidayBuilders\vendor\laravel\framework\src\Illuminate\Events\Dispatcher.php:381 {
Illuminate\Events\Dispatcher->Illuminate\Events\{closure} …
›
› return $listener(...array_values($payload));
› };
}
D:\CustomDomains\HolidayBuilders\vendor\laravel\framework\src\Illuminate\Events\Dispatcher.php:226 {
Illuminate\Events\Dispatcher->dispatch($event, $payload = [], $halt = false) …
› foreach ($this->getListeners($event) as $listener) {
› $response = $listener($event, $payload);
›
}
D:\CustomDomains\HolidayBuilders\vendor\laravel\framework\src\Illuminate\View\Concerns\ManagesEvents.php:177 {
Illuminate\View\Factory->callComposer(View $view) …
› {
› $this->events->dispatch('composing: '.$view->name(), [$view]);
› }
}
D:\CustomDomains\HolidayBuilders\vendor\laravel\framework\src\Illuminate\View\View.php:120 {
Illuminate\View\View->renderContents() …
›
› $this->factory->callComposer($this);
›
}
D:\CustomDomains\HolidayBuilders\vendor\laravel\framework\src\Illuminate\View\View.php:91 {
Illuminate\View\View->render(callable $callback = null) …
› try {
› $contents = $this->renderContents();
›
}
D:\CustomDomains\HolidayBuilders\vendor\laravel\framework\src\Illuminate\Http\Response.php:62 {
Illuminate\Http\Response->setContent($content) …
› elseif ($content instanceof Renderable) {
› $content = $content->render();
› }
}
D:\CustomDomains\HolidayBuilders\vendor\laravel\framework\src\Illuminate\Http\Response.php:34 {
Illuminate\Http\Response->__construct($content = '', $status = 200, array $headers = []) …
›
› $this->setContent($content);
› $this->setStatusCode($status);
}
D:\CustomDomains\HolidayBuilders\vendor\laravel\framework\src\Illuminate\Routing\ResponseFactory.php:55 {
Illuminate\Routing\ResponseFactory->make($content = '', $status = 200, array $headers = []) …
› {
› return new Response($content, $status, $headers);
› }
}
D:\CustomDomains\HolidayBuilders\vendor\laravel\framework\src\Illuminate\Routing\ResponseFactory.php:85 {
Illuminate\Routing\ResponseFactory->view($view, $data = [], $status = 200, array $headers = []) …
›
› return $this->make($this->view->make($view, $data), $status, $headers);
› }
}
D:\CustomDomains\HolidayBuilders\app\Exceptions\Handler.php:65 {
App\Exceptions\Handler->render($request, Throwable $exception) …
› if ($this->shouldReport($exception)) {\r
› return response()->view('errors.500', [], 500);\r
› }\r
}
D:\CustomDomains\HolidayBuilders\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php:51 {
Illuminate\Routing\Pipeline->handleException($passable, Throwable $e) …
›
› $response = $handler->render($passable, $e);
›
}
D:\CustomDomains\HolidayBuilders\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:172 {
Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure} …
› } catch (Throwable $e) {
› return $this->handleException($passable, $e);
› }
}
D:\CustomDomains\HolidayBuilders\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:103 {
Illuminate\Pipeline\Pipeline->then(Closure $destination) …
›
› return $pipeline($this->passable);
› }
}
D:\CustomDomains\HolidayBuilders\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php:140 {
Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter($request) …
› ->through($this->app->shouldSkipMiddleware() ? [] : $this->middleware)
› ->then($this->dispatchToRouter());
› }
}
D:\CustomDomains\HolidayBuilders\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php:109 {
Illuminate\Foundation\Http\Kernel->handle($request) …
›
› $response = $this->sendRequestThroughRouter($request);
› } catch (Throwable $e) {
}
D:\CustomDomains\HolidayBuilders\public\index.php:57 {
› $response = $kernel->handle(\r
› $request = Illuminate\Http\Request::capture()\r
› );\r
}
}
}
第二个共同踪迹:
Symfony\Component\ErrorHandler\Error\FatalError {#44
-error: array:4 [
"type" => 1
"message" => """
Uncaught Error: Call to undefined method Illuminate\Support\Facades\Cache::rememberForever() in D:\CustomDomains\HolidayBuilders\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php:261\n
Stack trace:\n
#0 D:\CustomDomains\HolidayBuilders\app\Providers\ComposerServiceProvider.php(120): Illuminate\Support\Facades\Facade::__callStatic()\n
#1 D:\CustomDomains\HolidayBuilders\vendor\laravel\framework\src\Illuminate\Events\Dispatcher.php(381): App\Providers\ComposerServiceProvider->App\Providers\{closure}()\n
#2 D:\CustomDomains\HolidayBuilders\vendor\laravel\framework\src\Illuminate\Events\Dispatcher.php(226): Illuminate\Events\Dispatcher->Illuminate\Events\{closure}()\n
#3 D:\CustomDomains\HolidayBuilders\vendor\laravel\framework\src\Illuminate\View\Concerns\ManagesEvents.php(177): Illuminate\Events\Dispatcher->dispatch()\n
#4 D:\CustomDomains\HolidayBuilders\vendor\laravel\framework\src\Illuminate\View\View.php(120): Illuminate\View\Factory->callComposer()\n
#5 D:\CustomDomains\HolidayBuilders\vendor\laravel\fr
"""
"file" => "D:\CustomDomains\HolidayBuilders\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php"
"line" => 261
]
#message: """
Uncaught Error: Call to undefined method Illuminate\Support\Facades\Cache::rememberForever() in D:\CustomDomains\HolidayBuilders\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php:261\n
Stack trace:\n
#0 D:\CustomDomains\HolidayBuilders\app\Providers\ComposerServiceProvider.php(120): Illuminate\Support\Facades\Facade::__callStatic()\n
#1 D:\CustomDomains\HolidayBuilders\vendor\laravel\framework\src\Illuminate\Events\Dispatcher.php(381): App\Providers\ComposerServiceProvider->App\Providers\{closure}()\n
#2 D:\CustomDomains\HolidayBuilders\vendor\laravel\framework\src\Illuminate\Events\Dispatcher.php(226): Illuminate\Events\Dispatcher->Illuminate\Events\{closure}()\n
#3 D:\CustomDomains\HolidayBuilders\vendor\laravel\framework\src\Illuminate\View\Concerns\ManagesEvents.php(177): Illuminate\Events\Dispatcher->dispatch()\n
#4 D:\CustomDomains\HolidayBuilders\vendor\laravel\framework\src\Illuminate\View\View.php(120): Illuminate\View\Factory->callComposer()\n
#5 D:\CustomDomains\HolidayBuilders\vendor\laravel\fr
"""
#code: 0
#file: "D:\CustomDomains\HolidayBuilders\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php"
#line: 261
}
这是我的 ComposerServiceProvider@boot 方法中的代码:
view()->composer([
'welcome',
'web.metropolitan-detail',
'web.city-detail',
'web.community-detail',
'web.community-detail-parent',
'web.inventory-detail',
'web.move-in-ready',
'web.communities',
'web.search',
'errors.500'
], function ($view) {
$view->with([
'spotlights' => Cache::rememberForever('spotlights', function () {
return Spotlight::where('homepage', true)->limit(3)->get();
}),
'testimonials' => Cache::rememberForever('testimonials', function () {
return Testimonial::limit(3)->get();
}),
]);
});
我正在使用 Laravel 7。如果我可以提供任何其他信息,请告诉我。
最佳答案
有时您需要使用composer
来重建加载到项目中的供应商类的缓存。要完成此尝试,请使用:
composer dump-autoload
他们:
php artisan optimize && php artisan cache:clear
关于Laravel 错误:调用未定义的方法 Illuminate\Support\Facades\Cache::rememberForever(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68106648/
我收到多行错误,指出它有重复的类 Duplicate class android.support.v4.accessibilityservice.AccessibilityServiceInfoCom
我的项目昨天运行良好,今天却出现以下错误。请帮忙。 出了什么问题:无法解析配置“:app:debugCompileClasspath”的所有文件。 Could not find support-v4.
错误:配置项目“:app”时出现问题。 Could not find support-v4.jar (com.android.support:support-v4:24.0.0). Searched
我正在使用 react-native-webrtc 运行示例应用程序模块。我正在尝试在 android 中运行该应用程序,但出现这样的错误... * What went wrong: A probl
错误:配置项目“:app”时出现问题。 Could not find support-v4.jar (com.android.support:support-v4:24.0.0). Searched
我克隆了我的项目并使用 Android studio 打开,但构建失败并出现以下错误并且同一个项目在其他项目上运行良好。 出了什么问题:无法解析配置“:app:flavorUnsignedReleas
我正在运行示例应用程序......我正在使用 this模块.....但是我收到这样的错误... FAILURE: Build failed with an exception. * What went
我有一个 Ionic 项目,在升级到 OSx Mojave 后,出于某种原因不再构建。 该项目基于 Ionic 3 构建。 我有 Cordova CLI 7.0.0 当我运行时 ionic cordo
我有一个 Ionic 项目,在升级到 OSx Mojave 后,出于某种原因不再构建。 该项目基于 Ionic 3 构建。 我有 Cordova CLI 7.0.0 当我运行时 ionic cordo
添加 Android 平台(ionic cordova platform add android)后,我构建了我的 Ionic 项目(ionic cordova build android),但出现错
这个问题在这里已经有了答案: Manifest merger failed : Attribute application@appComponentFactory - Androidx (14 个答
关于我的 Gradle 文件中的以下“complie”: dependencies { compile 'com.android.support:support-v4:25.3.1' }
有些困惑。 我想更频繁地使用@supports 但是...我不关心浏览器如何看待它。希望您能说清楚,如果可以的话谢谢您。 如果浏览器本身不理解@supports,它如何计算@support 'not'
我刚刚升级到 Dart 2 和最新版本的 Flutter,现在我无法构建我的应用程序。我在互联网上环顾四周,但仍然不明白为什么会发生这种情况。 我得到的错误是: FAILURE: Build fail
我正在学习 Firebase,但由于以下错误而陷入困境: Error:Failed to resolve: com.android.support:customtabs:25.4.0 Error:Fa
我在构建本周时出于某种原因尝试使用Cordova进行项目时遇到问题: cordova build android gradle获取com.android.support:support alpha而不
对应的androidx是什么com.android.support:support-compat 的图书馆实现push notifications ? 他们说here它是 androidx 的一部分,
我正在尝试为我的应用设置插桩单元测试。并且我已根据以下开发者站点链接添加了依赖项。 https://developer.android.com/training/testing/unit-testin
当我想使用 Proguard 规则生成签名的 APK(发布)时,我收到了以下错误消息: Cannot find a version of 'com.android.support:support-an
这个问题在这里已经有了答案: Failed to resolve: com.android.support:appcompat-v7:26.0.0 (14 个答案) Failed to resolv
我是一名优秀的程序员,十分优秀!