CacheController.php 972 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. namespace App\Admin\Controllers\Tool;
  3. use App\Http\Controllers\Controller;
  4. use App\Models\Navigation;
  5. use Encore\Admin\Controllers\HasResourceActions;
  6. use Encore\Admin\Form;
  7. use Encore\Admin\Layout\Content;
  8. use Illuminate\Support\Facades\Cache;
  9. class CacheController extends Controller
  10. {
  11. use HasResourceActions;
  12. /**
  13. * Index interface.
  14. *
  15. * @param Content $content
  16. * @return Content
  17. */
  18. public function index(Content $content)
  19. {
  20. return $content
  21. ->header('更新缓存')
  22. ->description('')
  23. ->body(view('admin.cache.index'));
  24. }
  25. protected function form()
  26. {
  27. $form = new Form(new Navigation);
  28. $form->display('ID');
  29. $form->display('Created at');
  30. $form->display('Updated at');
  31. return $form;
  32. }
  33. public function clear()
  34. {
  35. Cache::flush();
  36. admin_success("成功", "清除成功");
  37. return back();
  38. }
  39. }