File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
resources/views/components Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 7
7
use Illuminate\Support\Facades\ File ;
8
8
use Database\Seeders\ ButtonSeeder ;
9
9
use App\Models\ Page ;
10
+ use App\Models\ Link ;
10
11
11
12
set_time_limit (0 );
12
13
429
430
session ([' update_error' => $e -> getMessage ()]);
430
431
}
431
432
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
+
432
457
try {
433
458
434
459
$themesPath = base_path (' themes' );
You can’t perform that action at this time.
0 commit comments