From 940020135638735b8c47658e1c764c0dceb9a062 Mon Sep 17 00:00:00 2001 From: Krzysztof Rewak Date: Thu, 26 Sep 2024 17:38:44 +0200 Subject: [PATCH 1/2] #145 - production seeder --- app/Console/Commands/FlushCache.php | 20 ++++++++++++++ .../Commands/FlushCachedScheduleLink.php | 19 +++++++++++++ database/seeders/ProductionSeeder.php | 27 +++++++++++++++++++ 3 files changed, 66 insertions(+) create mode 100644 app/Console/Commands/FlushCache.php create mode 100644 app/Console/Commands/FlushCachedScheduleLink.php create mode 100644 database/seeders/ProductionSeeder.php diff --git a/app/Console/Commands/FlushCache.php b/app/Console/Commands/FlushCache.php new file mode 100644 index 0000000..a35d818 --- /dev/null +++ b/app/Console/Commands/FlushCache.php @@ -0,0 +1,20 @@ +call(FlushCachedPageTitle::class); + $this->call(FlushCachedScheduleLink::class); + } +} diff --git a/app/Console/Commands/FlushCachedScheduleLink.php b/app/Console/Commands/FlushCachedScheduleLink.php new file mode 100644 index 0000000..c6fcbbf --- /dev/null +++ b/app/Console/Commands/FlushCachedScheduleLink.php @@ -0,0 +1,19 @@ +forget("scheduleLink"); + } +} diff --git a/database/seeders/ProductionSeeder.php b/database/seeders/ProductionSeeder.php new file mode 100644 index 0000000..2b71f46 --- /dev/null +++ b/database/seeders/ProductionSeeder.php @@ -0,0 +1,27 @@ +create(["email" => "admin@example.com"]); + + Setting::factory()->create(); + SectionSettings::query()->create([ + "banner_enabled" => true, + "about_enabled" => true, + "counters_enabled" => true, + "contact_enabled" => true, + ]); + } +} From 230717516a9d8f3714cf70d86468a99686123839 Mon Sep 17 00:00:00 2001 From: Krzysztof Rewak Date: Thu, 26 Sep 2024 17:41:40 +0200 Subject: [PATCH 2/2] #145 - csf --- app/Console/Commands/FlushCache.php | 3 +-- database/seeders/ProductionSeeder.php | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/app/Console/Commands/FlushCache.php b/app/Console/Commands/FlushCache.php index a35d818..6359c0d 100644 --- a/app/Console/Commands/FlushCache.php +++ b/app/Console/Commands/FlushCache.php @@ -4,7 +4,6 @@ namespace Keating\Console\Commands; -use Illuminate\Cache\CacheManager; use Illuminate\Console\Command; class FlushCache extends Command @@ -12,7 +11,7 @@ class FlushCache extends Command protected $signature = "cache:flush"; protected $description = "Flush cached data"; - public function handle(CacheManager $cache): void + public function handle(): void { $this->call(FlushCachedPageTitle::class); $this->call(FlushCachedScheduleLink::class); diff --git a/database/seeders/ProductionSeeder.php b/database/seeders/ProductionSeeder.php index 2b71f46..b30e683 100644 --- a/database/seeders/ProductionSeeder.php +++ b/database/seeders/ProductionSeeder.php @@ -5,7 +5,6 @@ namespace Database\Seeders; use Illuminate\Database\Seeder; -use Keating\Models\Section; use Keating\Models\SectionSettings; use Keating\Models\Setting; use Keating\Models\User;