Skip to content

Commit e54320e

Browse files
committed
Migrate Twitter icon to X
1 parent d5721ae commit e54320e

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

resources/views/components/finishing.blade.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Illuminate\Support\Facades\File;
88
use Database\Seeders\ButtonSeeder;
99
use App\Models\Page;
10+
use App\Models\Link;
1011
1112
set_time_limit(0);
1213
@@ -429,6 +430,30 @@
429430
session(['update_error' => $e->getMessage()]);
430431
}
431432
433+
try {
434+
435+
$links = Link::where('button_id', 94)->get()->groupBy('user_id');
436+
437+
foreach ($links as $userId => $userLinks) {
438+
$hasXTwitter = $userLinks->contains('title', 'x-twitter');
439+
440+
foreach ($userLinks as $link) {
441+
if ($link->title == 'twitter') {
442+
if ($hasXTwitter) {
443+
$link->delete();
444+
} else {
445+
$link->title = 'x-twitter';
446+
$link->save();
447+
$hasXTwitter = true;
448+
}
449+
}
450+
}
451+
}
452+
453+
} catch (exception $e) {
454+
session(['update_error' => $e->getMessage()]);
455+
}
456+
432457
try {
433458
434459
$themesPath = base_path('themes');

0 commit comments

Comments
 (0)