Refactor ProgramSeeder to structure daily activities into a more organized format, replacing date keys with an array of day and activities for improved clarity and maintainability.
This commit is contained in:
@@ -137,7 +137,7 @@ class ProgramResource extends Resource
|
||||
if (is_array($data['days'])) {
|
||||
foreach ($data['days'] as $day) {
|
||||
if (isset($day['day']) && isset($day['activities'])) {
|
||||
$days[date('d.m.Y', strtotime($day['day']))] = $day['activities'];
|
||||
$days[$day['day']] = $day['activities'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,196 +14,232 @@ class ProgramSeeder extends Seeder
|
||||
public function run(): void
|
||||
{
|
||||
$days = [
|
||||
'19.09.2025' => [
|
||||
[
|
||||
'time' => '05:10',
|
||||
'title' => 'Jidda gonmak',
|
||||
'description' => 'Jidda aýraportynda zyýarata gelenleri garşy almak',
|
||||
'iconSet' => 'FontAwesome',
|
||||
'iconName' => 'plane',
|
||||
'transport' => 'plane',
|
||||
],
|
||||
[
|
||||
'time' => '',
|
||||
'title' => 'Medinä gitmek',
|
||||
'description' => 'Simkart almak we awtobusa ýerleşmek',
|
||||
'iconSet' => 'FontAwesome',
|
||||
'iconName' => 'bus',
|
||||
'transport' => 'bus',
|
||||
],
|
||||
[
|
||||
'time' => '',
|
||||
'title' => 'Otele ýerleşmek',
|
||||
'description' => 'Otaglara ýerleşmek',
|
||||
'iconSet' => 'FontAwesome',
|
||||
'iconName' => 'hotel',
|
||||
'transport' => 'bus',
|
||||
],
|
||||
[
|
||||
'time' => 'günüň dowamynda',
|
||||
'title' => 'Pygamberimiziň (saw) metjidi',
|
||||
'description' => 'Pygamberimiziň (saw) metjidine zyýarata gitmek',
|
||||
'iconSet' => 'FontAwesome5',
|
||||
'iconName' => 'mosque',
|
||||
'transport' => 'bus',
|
||||
[
|
||||
'day' => '2025-09-19',
|
||||
'activities' => [
|
||||
[
|
||||
'time' => '05:10',
|
||||
'title' => 'Jidda gonmak',
|
||||
'description' => 'Jidda aýraportynda zyýarata gelenleri garşy almak',
|
||||
'iconSet' => 'FontAwesome',
|
||||
'iconName' => 'plane',
|
||||
'transport' => 'plane',
|
||||
],
|
||||
[
|
||||
'time' => null,
|
||||
'title' => 'Medinä gitmek',
|
||||
'description' => 'Simkart almak we awtobusa ýerleşmek',
|
||||
'iconSet' => 'FontAwesome',
|
||||
'iconName' => 'bus',
|
||||
'transport' => 'bus',
|
||||
],
|
||||
[
|
||||
'time' => null,
|
||||
'title' => 'Otele ýerleşmek',
|
||||
'description' => 'Otaglara ýerleşmek',
|
||||
'iconSet' => 'FontAwesome',
|
||||
'iconName' => 'hotel',
|
||||
'transport' => 'bus',
|
||||
],
|
||||
[
|
||||
'time' => 'günüň dowamynda',
|
||||
'title' => 'Pygamberimiziň (saw) metjidi',
|
||||
'description' => 'Pygamberimiziň (saw) metjidine zyýarata gitmek',
|
||||
'iconSet' => 'FontAwesome5',
|
||||
'iconName' => 'mosque',
|
||||
'transport' => 'bus',
|
||||
],
|
||||
],
|
||||
],
|
||||
'20.09.2025' => [
|
||||
[
|
||||
'time' => 'günüň dowamynda',
|
||||
'title' => 'Pygamberimiziň (saw) metjidi',
|
||||
'description' => 'Pygamberimiziň (saw) metjidine zyýarata gitmek',
|
||||
'iconSet' => 'FontAwesome5',
|
||||
'iconName' => 'mosque',
|
||||
'transport' => 'bus',
|
||||
[
|
||||
'day' => '2025-09-20',
|
||||
'activities' => [
|
||||
[
|
||||
'time' => 'günüň dowamynda',
|
||||
'title' => 'Pygamberimiziň (saw) metjidi',
|
||||
'description' => 'Pygamberimiziň (saw) metjidine zyýarata gitmek',
|
||||
'iconSet' => 'FontAwesome5',
|
||||
'iconName' => 'mosque',
|
||||
'transport' => 'bus',
|
||||
],
|
||||
],
|
||||
],
|
||||
'21.09.2025' => [
|
||||
[
|
||||
'time' => '07:00',
|
||||
'title' => 'Zyýarat ýerleri',
|
||||
'description' => 'Medine şäherindäki ähli zyýarat ýerlerine zyýarat etmek, Kuba metjidi, Kyblateýin metjidi, Uhud daglary, Hurma baglary',
|
||||
'iconSet' => 'FontAwesome5',
|
||||
'iconName' => 'gopuram',
|
||||
'transport' => 'bus',
|
||||
],
|
||||
[
|
||||
'time' => '',
|
||||
'title' => 'Kuran zawody',
|
||||
'description' => 'Eger açyk bolup mümkinçilik bolsa',
|
||||
'iconSet' => 'FontAwesome5',
|
||||
'iconName' => 'quran',
|
||||
'transport' => 'bus',
|
||||
],
|
||||
[
|
||||
'time' => 'günüň dowamynda',
|
||||
'title' => 'Pygamberimiziň (saw) metjidi',
|
||||
'description' => '',
|
||||
'iconSet' => 'FontAwesome5',
|
||||
'iconName' => 'mosque',
|
||||
'transport' => 'bus',
|
||||
[
|
||||
'day' => '2025-09-21',
|
||||
'activities' => [
|
||||
[
|
||||
'time' => '07:00',
|
||||
'title' => 'Zyýarat ýerleri',
|
||||
'description' => 'Medine şäherindäki ähli zyýarat ýerlerine zyýarat etmek, Kuba metjidi, Kyblateýin metjidi, Uhud daglary, Hurma baglary',
|
||||
'iconSet' => 'FontAwesome5',
|
||||
'iconName' => 'gopuram',
|
||||
'transport' => 'bus',
|
||||
],
|
||||
[
|
||||
'time' => null,
|
||||
'title' => 'Kuran zawody',
|
||||
'description' => 'Eger açyk bolup mümkinçilik bolsa',
|
||||
'iconSet' => 'FontAwesome5',
|
||||
'iconName' => 'quran',
|
||||
'transport' => 'bus',
|
||||
],
|
||||
[
|
||||
'time' => 'günüň dowamynda',
|
||||
'title' => 'Pygamberimiziň (saw) metjidi',
|
||||
'description' => null,
|
||||
'iconSet' => 'FontAwesome5',
|
||||
'iconName' => 'mosque',
|
||||
'transport' => 'bus',
|
||||
],
|
||||
],
|
||||
],
|
||||
'22.09.2025' => [
|
||||
[
|
||||
'time' => '',
|
||||
'title' => 'Myhmanhanadan çykmak',
|
||||
'description' => '',
|
||||
'iconSet' => 'FontAwesome',
|
||||
'iconName' => 'hotel',
|
||||
'transport' => 'bus',
|
||||
],
|
||||
[
|
||||
'time' => '14:00',
|
||||
'title' => 'Mekkä gitmek (Umra)',
|
||||
'description' => '',
|
||||
'iconSet' => 'FontAwesome',
|
||||
'iconName' => 'bus',
|
||||
'transport' => 'bus',
|
||||
],
|
||||
[
|
||||
'time' => '',
|
||||
'title' => 'Best Western oteline ýerleşmek',
|
||||
'description' => 'Otaglara ýerleşmek',
|
||||
'iconSet' => 'FontAwesome',
|
||||
'iconName' => 'hotel',
|
||||
'transport' => 'bus',
|
||||
],
|
||||
[
|
||||
'time' => 'günüň dowamynda',
|
||||
'title' => 'Umra zyýaraty',
|
||||
'description' => '',
|
||||
'iconSet' => 'FontAwesome5',
|
||||
'iconName' => 'kaaba',
|
||||
'transport' => 'bus',
|
||||
[
|
||||
'day' => '2025-09-22',
|
||||
'activities' => [
|
||||
[
|
||||
'time' => null,
|
||||
'title' => 'Myhmanhanadan çykmak',
|
||||
'description' => null,
|
||||
'iconSet' => 'FontAwesome',
|
||||
'iconName' => 'hotel',
|
||||
'transport' => 'bus',
|
||||
],
|
||||
[
|
||||
'time' => '14:00',
|
||||
'title' => 'Mekkä gitmek (Umra)',
|
||||
'description' => null,
|
||||
'iconSet' => 'FontAwesome',
|
||||
'iconName' => 'bus',
|
||||
'transport' => 'bus',
|
||||
],
|
||||
[
|
||||
'time' => null,
|
||||
'title' => 'Best Western oteline ýerleşmek',
|
||||
'description' => 'Otaglara ýerleşmek',
|
||||
'iconSet' => 'FontAwesome',
|
||||
'iconName' => 'hotel',
|
||||
'transport' => 'bus',
|
||||
],
|
||||
[
|
||||
'time' => 'günüň dowamynda',
|
||||
'title' => 'Umra zyýaraty',
|
||||
'description' => null,
|
||||
'iconSet' => 'FontAwesome5',
|
||||
'iconName' => 'kaaba',
|
||||
'transport' => 'bus',
|
||||
],
|
||||
],
|
||||
],
|
||||
'24.09.2025' => [
|
||||
[
|
||||
'time' => '15:00',
|
||||
'title' => 'Optom bazary',
|
||||
'description' => 'Kakiyya Bazaryna gitmek',
|
||||
'iconSet' => 'FontAwesome',
|
||||
'iconName' => 'shopping-bag',
|
||||
'transport' => 'bus',
|
||||
[
|
||||
'day' => '2025-09-24',
|
||||
'activities' => [
|
||||
[
|
||||
'time' => '15:00',
|
||||
'title' => 'Optom bazary',
|
||||
'description' => 'Kakiyya Bazaryna gitmek',
|
||||
'iconSet' => 'FontAwesome',
|
||||
'iconName' => 'shopping-bag',
|
||||
'transport' => 'bus',
|
||||
],
|
||||
],
|
||||
],
|
||||
'25.09.2025' => [
|
||||
[
|
||||
'time' => '07:00',
|
||||
'title' => 'Aýşa metjidi (Umra)',
|
||||
'description' => 'Aýşa enemiziň metjidine gitmek',
|
||||
'iconSet' => 'FontAwesome5',
|
||||
'iconName' => 'mosque',
|
||||
'transport' => 'bus',
|
||||
[
|
||||
'day' => '2025-09-25',
|
||||
'activities' => [
|
||||
[
|
||||
'time' => '07:00',
|
||||
'title' => 'Aýşa metjidi (Umra)',
|
||||
'description' => 'Aýşa enemiziň metjidine gitmek',
|
||||
'iconSet' => 'FontAwesome5',
|
||||
'iconName' => 'mosque',
|
||||
'transport' => 'bus',
|
||||
],
|
||||
],
|
||||
],
|
||||
'26.09.2025' => [
|
||||
[
|
||||
'time' => 'günüň dowamynda',
|
||||
'title' => 'Juma',
|
||||
'description' => '',
|
||||
'iconSet' => 'FontAwesome5',
|
||||
'iconName' => 'mosque',
|
||||
'transport' => 'bus',
|
||||
[
|
||||
'day' => '2025-09-26',
|
||||
'activities' => [
|
||||
[
|
||||
'time' => 'günüň dowamynda',
|
||||
'title' => 'Juma',
|
||||
'description' => null,
|
||||
'iconSet' => 'FontAwesome5',
|
||||
'iconName' => 'mosque',
|
||||
'transport' => 'bus',
|
||||
],
|
||||
],
|
||||
],
|
||||
'27.09.2025' => [
|
||||
[
|
||||
'time' => '07:00',
|
||||
'title' => 'Gyzyl deňizi we Howa enemize zyýarat',
|
||||
'description' => '',
|
||||
'iconSet' => 'FontAwesome5',
|
||||
'iconName' => 'water',
|
||||
'transport' => 'bus',
|
||||
[
|
||||
'day' => '2025-09-27',
|
||||
'activities' => [
|
||||
[
|
||||
'time' => '07:00',
|
||||
'title' => 'Gyzyl deňizi we Howa enemize zyýarat',
|
||||
'description' => null,
|
||||
'iconSet' => 'FontAwesome5',
|
||||
'iconName' => 'water',
|
||||
'transport' => 'bus',
|
||||
],
|
||||
],
|
||||
],
|
||||
'28.09.2025' => [
|
||||
[
|
||||
'time' => '07:00',
|
||||
'title' => 'Mekke zyýaratlary',
|
||||
'description' => 'Arafat dagy, Nur dagy, Sawr dagy, Mina-Muzdalifa daglaryna zyýarat etmek',
|
||||
'iconSet' => 'FontAwesome5',
|
||||
'iconName' => 'gopuram',
|
||||
'transport' => 'bus',
|
||||
[
|
||||
'day' => '2025-09-28',
|
||||
'activities' => [
|
||||
[
|
||||
'time' => '07:00',
|
||||
'title' => 'Mekke zyýaratlary',
|
||||
'description' => 'Arafat dagy, Nur dagy, Sawr dagy, Mina-Muzdalifa daglaryna zyýarat etmek',
|
||||
'iconSet' => 'FontAwesome5',
|
||||
'iconName' => 'gopuram',
|
||||
'transport' => 'bus',
|
||||
],
|
||||
],
|
||||
],
|
||||
'29.09.2025' => [
|
||||
[
|
||||
'time' => '07:00',
|
||||
'title' => 'Taif şäheri (Umra)',
|
||||
'description' => '',
|
||||
'iconSet' => 'FontAwesome5',
|
||||
'iconName' => 'mountain',
|
||||
'transport' => 'bus',
|
||||
[
|
||||
'day' => '2025-09-29',
|
||||
'activities' => [
|
||||
[
|
||||
'time' => '07:00',
|
||||
'title' => 'Taif şäheri (Umra)',
|
||||
'description' => null,
|
||||
'iconSet' => 'FontAwesome5',
|
||||
'iconName' => 'mountain',
|
||||
'transport' => 'bus',
|
||||
],
|
||||
],
|
||||
],
|
||||
'01.10.2025' => [
|
||||
[
|
||||
'time' => '23:00',
|
||||
'title' => 'Nur dagyna çykmak',
|
||||
'description' => '',
|
||||
'iconSet' => 'FontAwesome5',
|
||||
'iconName' => 'mountain',
|
||||
'transport' => 'bus',
|
||||
[
|
||||
'day' => '2025-10-01',
|
||||
'activities' => [
|
||||
[
|
||||
'time' => '23:00',
|
||||
'title' => 'Nur dagyna çykmak',
|
||||
'description' => null,
|
||||
'iconSet' => 'FontAwesome5',
|
||||
'iconName' => 'mountain',
|
||||
'transport' => 'bus',
|
||||
],
|
||||
],
|
||||
],
|
||||
'03.10.2025' => [
|
||||
[
|
||||
'time' => '12:00',
|
||||
'title' => 'Myhmanhanada çykmak',
|
||||
'description' => '',
|
||||
'iconSet' => 'FontAwesome',
|
||||
'iconName' => 'hotel',
|
||||
'transport' => 'bus',
|
||||
],
|
||||
[
|
||||
'time' => '',
|
||||
'title' => 'Jidda Aýraporda tarap',
|
||||
'description' => '',
|
||||
'iconSet' => 'FontAwesome',
|
||||
'iconName' => 'bus',
|
||||
'transport' => 'bus',
|
||||
[
|
||||
'day' => '2025-10-03',
|
||||
'activities' => [
|
||||
[
|
||||
'time' => '12:00',
|
||||
'title' => 'Myhmanhanada çykmak',
|
||||
'description' => null,
|
||||
'iconSet' => 'FontAwesome',
|
||||
'iconName' => 'hotel',
|
||||
'transport' => 'bus',
|
||||
],
|
||||
[
|
||||
'time' => null,
|
||||
'title' => 'Jidda Aýraporda tarap',
|
||||
'description' => null,
|
||||
'iconSet' => 'FontAwesome',
|
||||
'iconName' => 'bus',
|
||||
'transport' => 'bus',
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
@@ -211,7 +247,7 @@ class ProgramSeeder extends Seeder
|
||||
Program::create([
|
||||
'name' => 'Adaty Programma',
|
||||
'group_id' => Group::first()->id,
|
||||
'days' => json_encode($days),
|
||||
'days' => $days,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user