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