我目前在我的settings
表中设置了很多设置,在我的本地服务器上一切都很好,但问题出在在线环境中,我不知道是否需要配置任何东西,但它没有设置缓存,它可以是什么?
class SettingsServiceProvider extends ServiceProvider
{
public function boot(Factory $cache, SettingRepository $settings)
{
if(Schema::hasTable('settings')){
$settings = $cache->remember('settings', 60, function() use ($settings)
{
return $settings->lists();
});
config()->set('settings', $settings);
}
}
public function register()
{
$this->app->bind(
\App\Repositories\SettingRepository::class
);
}
}
答案 0 :(得分:0)
composer clear-cache
&& composer dump-autoload
解决了问题