laravel所有清空缓存命令并在代码中调用

2020-05-24 08:12:48
//清空各种缓存public function clear(){
	Artisan::call('cache:clear');
	Artisan::call('config:clear');
	Artisan::call('route:clear');
	Artisan::call('view:clear');
	Artisan::call('clear-compiled');
	Artisan::call('modelCache:clear');
	flash_success('操作成功');	return redirect()->back();
}


这些编译好了的视图缓存。



   php artisan view:clear   


1

2

3

清除运行缓存:



   php artisan cache:clear 


1

2

3

Laravel修改配置后一定要清理缓存,清除配置缓存:



   php artisan config:clear


1

2

3

清除路由缓存:



   php artisan route:clear


1

2

3

创建建立session表迁移:



   php artisan session:table




  • 2017-02-24 16:53:58

    PHP 中的Closure

    Closure,匿名函数,又称为Anonymous functions,是php5.3的时候引入的。匿名函数就是没有定义名字的函数。这点牢牢记住就能理解匿名函数的定义了。

  • 2017-03-02 09:45:27

    动态加载js和css

    开发过程中经常需要动态加载js和css,今天特意总结了一下常用的方法。