File: /mnt/data/ghayatcom/ghayatcom-api/database/seeders/PageModuleSeeder.php
<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
use App\PageModule;
class PageModuleSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$datas = [
1 => [
'page' => 'landing home',
'section' => 'heading',
'is_enabled' => 'yes',
],
2 => [
'page' => 'landing home',
'section' => 'doctors_list',
'is_enabled' => 'yes',
],
3 => [
'page' => 'landing home',
'section' => 'mission_vision',
'is_enabled' => 'yes',
],
4 => [
'page' => 'landing home',
'section' => 'how_it_works',
'is_enabled' => 'yes',
],
5 => [
'page' => 'landing home',
'section' => 'why_choose_us',
'is_enabled' => 'yes',
],
6 => [
'page' => 'landing home',
'section' => 'service_offer',
'is_enabled' => 'yes',
],
7 => [
'page' => 'landing home',
'section' => 'contact_us',
'is_enabled' => 'yes',
],
8 => [
'page' => 'landing home',
'section' => 'client_logos',
'is_enabled' => 'yes',
],
9 => [
'page' => 'landing home',
'section' => 'our_insights',
'is_enabled' => 'yes',
],
10 => [
'page' => 'landing home',
'section' => 'footer',
'is_enabled' => 'yes',
],
];
foreach ($datas as $id => $data) {
$row = PageModule::firstOrNew([
'id' => $id,
]);
$row->fill($data);
$row->save();
}
}
}