turtle-wow-source-kinda/Dumps/Source Code/8 - Development_website/master/database/seeders/ImportDynamicContent.php
Brian Oost a1d5bb70b2 Init
2024-08-06 18:06:40 +02:00

28 lines
561 B
PHP

<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB;
class ImportDynamicContent extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
DB::table('sections')->truncate();
$sqlFilePath = database_path('dynamic_content/sections.sql');
$sql = file_get_contents($sqlFilePath);
DB::unprepared($sql);
Cache::flush();
$this->command->info('sections.sql import complete.');
}
}