createAllSocials();
}
private function createAllSocials(): void
{
$socials = [
[
'title' => 'Linkedin',
'subtitle' => 'Developments in the sector',
'key' => 'linkedin',
'link' => '#',
'icon' => '',
],
[
'title' => 'Telegram',
'subtitle' => 'Fast instant communication',
'key' => 'telegram',
'link' => '#',
'icon' => '',
],
[
'title' => 'Behance',
'subtitle' => 'A wide visibility',
'key' => 'behance',
'link' => '#',
'icon' => '',
],
[
'title' => 'X',
'subtitle' => 'Latest news and updates',
'key' => 'twitter',
'link' => '#',
'icon' => '',
],
[
'title' => 'Instagram',
'subtitle' => 'Share your photos',
'key' => 'instagram',
'link' => '#',
'icon' => '',
],
[
'title' => 'Facebook',
'subtitle' => 'The most popular social media',
'key' => 'facebook',
'link' => '#',
'icon' => '',
],
];
foreach ($socials as $social) {
$this->createSocial(...$social);
}
}
private function createSocial(string $title, string $subtitle, string $key, string $link, string $icon): void
{
SocialMediaAccounts::query()
->firstOrCreate([
'key' => $key,
], [
'title' => $title,
'subtitle' => $subtitle,
'key' => $key,
'link' => $link,
'icon' => $icon,
'is_active' => true,
]);
}
}