diff --git a/app/Http/Controllers/DomainsController.php b/app/Http/Controllers/DomainsController.php index 3f115b8..78e7cc8 100644 --- a/app/Http/Controllers/DomainsController.php +++ b/app/Http/Controllers/DomainsController.php @@ -7,6 +7,7 @@ use App\Models\Labels; use App\Models\Pricing; use App\Models\Providers; use Illuminate\Http\Request; +use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\DB; use Illuminate\Support\Str; @@ -92,6 +93,10 @@ class DomainsController extends Controller } } + Cache::forget('services_count');//Main page services_count cache + Cache::forget('due_soon');//Main page due_soon cache + Cache::forget('recently_added');//Main page recently_added cache + return redirect()->route('domains.index') ->with('success', 'Domain Created Successfully.'); } @@ -158,6 +163,10 @@ class DomainsController extends Controller } } + Cache::forget('services_count');//Main page services_count cache + Cache::forget('due_soon');//Main page due_soon cache + Cache::forget('recently_added');//Main page recently_added cache + return redirect()->route('domains.index') ->with('success', 'Domain Updated Successfully.'); } @@ -173,6 +182,10 @@ class DomainsController extends Controller Labels::deleteLabelsAssignedTo($domain->id); + Cache::forget('services_count');//Main page services_count cache + Cache::forget('due_soon');//Main page due_soon cache + Cache::forget('recently_added');//Main page recently_added cache + return redirect()->route('domains.index') ->with('success', 'Domain was deleted Successfully.'); } diff --git a/app/Http/Controllers/MiscController.php b/app/Http/Controllers/MiscController.php index fbd0394..a6d899e 100644 --- a/app/Http/Controllers/MiscController.php +++ b/app/Http/Controllers/MiscController.php @@ -5,6 +5,7 @@ namespace App\Http\Controllers; use App\Models\Misc; use App\Models\Pricing; use Illuminate\Http\Request; +use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\DB; use Illuminate\Support\Str; @@ -66,6 +67,10 @@ class MiscController extends Controller 'next_due_date' => $request->next_due_date, ]); + Cache::forget('services_count');//Main page services_count cache + Cache::forget('due_soon');//Main page due_soon cache + Cache::forget('recently_added');//Main page recently_added cache + return redirect()->route('misc.index') ->with('success', 'Misc service created Successfully.'); } @@ -111,6 +116,10 @@ class MiscController extends Controller 'active' => (isset($request->is_active)) ? 1 : 0 ]); + Cache::forget('services_count');//Main page services_count cache + Cache::forget('due_soon');//Main page due_soon cache + Cache::forget('recently_added');//Main page recently_added cache + return redirect()->route('misc.index') ->with('success', 'Misc service updated Successfully.'); } @@ -124,6 +133,10 @@ class MiscController extends Controller $p = new Pricing(); $p->deletePricing($misc->id); + Cache::forget('services_count');//Main page services_count cache + Cache::forget('due_soon');//Main page due_soon cache + Cache::forget('recently_added');//Main page recently_added cache + return redirect()->route('misc.index') ->with('success', 'Misc service was deleted Successfully.'); } diff --git a/app/Http/Controllers/ResellerController.php b/app/Http/Controllers/ResellerController.php index 882514a..074413b 100644 --- a/app/Http/Controllers/ResellerController.php +++ b/app/Http/Controllers/ResellerController.php @@ -9,6 +9,7 @@ use App\Models\Pricing; use App\Models\Providers; use App\Models\Reseller; use Illuminate\Http\Request; +use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\DB; use Illuminate\Support\Str; @@ -108,6 +109,10 @@ class ResellerController extends Controller ); } + Cache::forget('services_count');//Main page services_count cache + Cache::forget('due_soon');//Main page due_soon cache + Cache::forget('recently_added');//Main page recently_added cache + return redirect()->route('reseller.index') ->with('success', 'Reseller hosting created Successfully.'); } @@ -221,6 +226,10 @@ class ResellerController extends Controller ]); } + Cache::forget('services_count');//Main page services_count cache + Cache::forget('due_soon');//Main page due_soon cache + Cache::forget('recently_added');//Main page recently_added cache + return redirect()->route('reseller.index') ->with('success', 'Reseller hosting updated Successfully.'); } @@ -239,6 +248,10 @@ class ResellerController extends Controller IPs::deleteIPsAssignedTo($id); + Cache::forget('services_count');//Main page services_count cache + Cache::forget('due_soon');//Main page due_soon cache + Cache::forget('recently_added');//Main page recently_added cache + return redirect()->route('reseller.index') ->with('success', 'Reseller hosting was deleted Successfully.'); } diff --git a/app/Http/Controllers/ServerController.php b/app/Http/Controllers/ServerController.php index 4a3f0b4..0901dad 100644 --- a/app/Http/Controllers/ServerController.php +++ b/app/Http/Controllers/ServerController.php @@ -11,6 +11,7 @@ use App\Models\Providers; use App\Models\Locations; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; +use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\Config; use Illuminate\Support\Facades\Session; use Illuminate\Support\Str; @@ -161,6 +162,10 @@ class ServerController extends Controller } } + Cache::forget('services_count');//Main page services_count cache + Cache::forget('due_soon');//Main page due_soon cache + Cache::forget('recently_added');//Main page recently_added cache + return redirect()->route('servers.index') ->with('success', 'Server Created Successfully.'); } @@ -296,6 +301,10 @@ class ServerController extends Controller } } + Cache::forget('services_count');//Main page services_count cache + Cache::forget('due_soon');//Main page due_soon cache + Cache::forget('recently_added');//Main page recently_added cache + return redirect()->route('servers.index') ->with('success', 'Server Updated Successfully.'); } @@ -313,6 +322,10 @@ class ServerController extends Controller IPs::deleteIPsAssignedTo($server->id); + Cache::forget('services_count');//Main page services_count cache + Cache::forget('due_soon');//Main page due_soon cache + Cache::forget('recently_added');//Main page recently_added cache + return redirect()->route('servers.index') ->with('success', 'Server was deleted Successfully.'); } diff --git a/app/Http/Controllers/SettingsController.php b/app/Http/Controllers/SettingsController.php index 4625eee..3d73bbd 100644 --- a/app/Http/Controllers/SettingsController.php +++ b/app/Http/Controllers/SettingsController.php @@ -4,6 +4,7 @@ namespace App\Http\Controllers; use App\Models\Settings; use Illuminate\Http\Request; +use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Session; @@ -53,6 +54,8 @@ class SettingsController extends Controller Session::put('show_server_value_location', $request->show_server_value_location); Session::save(); + Cache::forget('settings');//Main page settings cache + return redirect()->route('settings.index') ->with('success', 'Settings Updated Successfully.'); } diff --git a/app/Http/Controllers/SharedController.php b/app/Http/Controllers/SharedController.php index 8f8d5ce..e1b4085 100644 --- a/app/Http/Controllers/SharedController.php +++ b/app/Http/Controllers/SharedController.php @@ -9,6 +9,7 @@ use App\Models\Pricing; use App\Models\Providers; use App\Models\Shared; use Illuminate\Http\Request; +use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\DB; use Illuminate\Support\Str; @@ -113,6 +114,10 @@ class SharedController extends Controller ); } + Cache::forget('services_count');//Main page services_count cache + Cache::forget('due_soon');//Main page due_soon cache + Cache::forget('recently_added');//Main page recently_added cache + return redirect()->route('shared.index') ->with('success', 'Shared hosting created Successfully.'); } @@ -239,6 +244,10 @@ class SharedController extends Controller ]); } + Cache::forget('services_count');//Main page services_count cache + Cache::forget('due_soon');//Main page due_soon cache + Cache::forget('recently_added');//Main page recently_added cache + return redirect()->route('shared.index') ->with('success', 'Shared hosting updated Successfully.'); } @@ -257,6 +266,10 @@ class SharedController extends Controller IPs::deleteIPsAssignedTo($shared->id); + Cache::forget('services_count');//Main page services_count cache + Cache::forget('due_soon');//Main page due_soon cache + Cache::forget('recently_added');//Main page recently_added cache + return redirect()->route('shared.index') ->with('success', 'Shared hosting was deleted Successfully.'); }