├── .gitignore ├── CacheManager ├── CacheManager.php ├── CacheManagerController.php ├── CacheManagerListener.php ├── CacheManagerWidget.php ├── meta.yaml ├── resources │ ├── assets │ │ └── css │ │ │ └── cachemanager.css │ └── views │ │ └── widget.blade.php └── routes.yaml ├── LICENSE └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | vendor/ 2 | node_modules/ 3 | .idea 4 | 5 | # Laravel 4 specific 6 | bootstrap/compiled.php 7 | app/storage/ 8 | 9 | # Laravel 5 & Lumen specific 10 | bootstrap/cache/ 11 | storage/ 12 | .env.*.php 13 | .env.php 14 | .env 15 | .env.example -------------------------------------------------------------------------------- /CacheManager/CacheManager.php: -------------------------------------------------------------------------------- 1 | cachemanager = new CacheManager(); 19 | } 20 | 21 | /** 22 | * Clear Statamic cache 23 | */ 24 | public function clearAll() 25 | { 26 | try { 27 | // Update feed 28 | $this->cachemanager->clearCache(); 29 | 30 | // Log success returns 31 | Log::info('All cache cleared successfully'); 32 | 33 | // Return back to dashboard with success message 34 | return back()->with('success', 'All cache cleared successfully'); 35 | } catch (\Exception $e) { 36 | Log::error('Problem clearing your cache'); 37 | return back()->withErrors('error', ' Problem clearing your all/one of cache' . $e); 38 | } 39 | } 40 | 41 | 42 | /** 43 | * Update Stache cache 44 | */ 45 | public function updateStache() 46 | { 47 | try { 48 | // Update feed 49 | $this->cachemanager->updateStache(); 50 | 51 | // Log success returns 52 | Log::info('Stache updated successfully'); 53 | 54 | // Return back to dashboard with success message 55 | return back()->with('success', 'Stache updated successfully'); 56 | } catch (\Exception $e) { 57 | Log::error('Problem updating your stache'); 58 | return back()->withErrors('error', ' Problem updating your stache' . $e); 59 | } 60 | } 61 | 62 | 63 | /** 64 | * Clear Statamic cache 65 | */ 66 | public function clearCache() 67 | { 68 | 69 | try { 70 | // Update feed 71 | $this->cachemanager->clearCache(); 72 | 73 | // Log success returns 74 | Log::info('Cache cleared successfully'); 75 | 76 | // Return back to dashboard with success message 77 | return back()->with('success', 'Cache cleared successfully'); 78 | } catch (\Exception $e) { 79 | Log::error('Problem clearing your cache'); 80 | return back()->withErrors('error', ' Problem clearing your cache' . $e); 81 | } 82 | } 83 | 84 | 85 | /** 86 | * Clear Glide cache 87 | */ 88 | public function clearGlide() 89 | { 90 | 91 | try { 92 | $this->cachemanager->clearGlide(); 93 | 94 | // Log success returns 95 | Log::info('Glide cache cleared successfully'); 96 | 97 | // Return back to dashboard with success message 98 | return back()->with('success', 'Glide cache cleared successfully'); 99 | } catch (\Exception $e) { 100 | Log::error('Problem clearing glide cache'); 101 | return back()->withErrors('error', ' Problem clearing glide cache' . $e); 102 | } 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /CacheManager/CacheManagerListener.php: -------------------------------------------------------------------------------- 1 | 'initCacheManager', 16 | ]; 17 | 18 | 19 | /** 20 | * Initialize Aggregator assets 21 | * @return string 22 | */ 23 | public function initCacheManager() 24 | { 25 | return $this->css->tag('cachemanager.css'); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /CacheManager/CacheManagerWidget.php: -------------------------------------------------------------------------------- 1 | getMeta()['url']; 18 | 19 | return $this->view('widget', compact('github_page'))->render(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /CacheManager/meta.yaml: -------------------------------------------------------------------------------- 1 | name: CacheManager 2 | version: 1.0.3 3 | description: Manage your statamic cache 4 | url: https://github.com/lesaff/statamic-cachemanager 5 | developer: Rudy Affandi 6 | developer_url: https://github.com/lesaff 7 | -------------------------------------------------------------------------------- /CacheManager/resources/assets/css/cachemanager.css: -------------------------------------------------------------------------------- 1 | #cachemanager .list { 2 | list-style-type: none; 3 | margin: 10px 0; 4 | padding: 0; 5 | } 6 | 7 | #cachemanager .list li { 8 | margin-bottom: 5px; 9 | padding: 0; 10 | } 11 | 12 | #cachemanager .list-separator li.border-top, 13 | #cachemanager .row-separator { 14 | border-top: 1px dotted #e0e0e0; 15 | margin-top: 5px; 16 | padding-top: 5px; 17 | } 18 | 19 | #cachemanager .list-separator li.first, 20 | #cachemanager .list li.first { 21 | border-top: 0 !important; 22 | } 23 | -------------------------------------------------------------------------------- /CacheManager/resources/views/widget.blade.php: -------------------------------------------------------------------------------- 1 |
22 | Clear Cache 23 | | 24 |
27 | Clear Glide (image) cache 28 | | 29 |
32 | Update Stache 33 | | 34 |