Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/#145-seeder' into #145-productio…
Browse files Browse the repository at this point in the history
…n-deployment
  • Loading branch information
Blusia committed Sep 27, 2024
2 parents 65434ac + 2307175 commit 55ee188
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 0 deletions.
19 changes: 19 additions & 0 deletions app/Console/Commands/FlushCache.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

declare(strict_types=1);

namespace Keating\Console\Commands;

use Illuminate\Console\Command;

class FlushCache extends Command
{
protected $signature = "cache:flush";
protected $description = "Flush cached data";

public function handle(): void
{
$this->call(FlushCachedPageTitle::class);
$this->call(FlushCachedScheduleLink::class);
}
}
19 changes: 19 additions & 0 deletions app/Console/Commands/FlushCachedScheduleLink.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

declare(strict_types=1);

namespace Keating\Console\Commands;

use Illuminate\Cache\CacheManager;
use Illuminate\Console\Command;

class FlushCachedScheduleLink extends Command
{
protected $signature = "cache:link:flush";
protected $description = "Flush cached schedule link";

public function handle(CacheManager $cache): void
{
$cache->forget("scheduleLink");
}
}
26 changes: 26 additions & 0 deletions database/seeders/ProductionSeeder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

declare(strict_types=1);

namespace Database\Seeders;

use Illuminate\Database\Seeder;
use Keating\Models\SectionSettings;
use Keating\Models\Setting;
use Keating\Models\User;

class ProductionSeeder extends Seeder
{
public function run(): void
{
User::factory()->create(["email" => "[email protected]"]);

Setting::factory()->create();
SectionSettings::query()->create([
"banner_enabled" => true,
"about_enabled" => true,
"counters_enabled" => true,
"contact_enabled" => true,
]);
}
}

0 comments on commit 55ee188

Please sign in to comment.