Passed
Push — main ( bdbaee...80491e )
by Julian
16:21 queued 10:39
created
app/Http/Controllers/UserController.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
     //Show littlelink page. example => http://127.0.0.1:8000/+admin
85 85
     public function littlelink(request $request)
86 86
     {
87
-        if(isset($request->useif)){
87
+        if (isset($request->useif)) {
88 88
             $littlelink_name = User::select('littlelink_name')->where('id', $request->littlelink)->value('littlelink_name');
89 89
             $id = $request->littlelink;
90 90
         } else {
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
             return abort(404);
141 141
         }
142 142
 
143
-        return redirect(url('@'.$user));
143
+        return redirect(url('@' . $user));
144 144
     }
145 145
 
146 146
     //Show add/update form
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
 
300 300
         if (substr($linkId, -1) == '+') {
301 301
             $linkWithoutPlus = str_replace('+', '', $linkId);
302
-            return redirect(url('info/'.$linkWithoutPlus));
302
+            return redirect(url('info/' . $linkWithoutPlus));
303 303
         }
304 304
     
305 305
         $link = Link::find($linkId);
@@ -390,11 +390,11 @@  discard block
 block discarded – undo
390 390
 
391 391
         $directory = base_path("assets/favicon/icons");
392 392
         $files = scandir($directory);
393
-        foreach($files as $file) {
394
-        if (strpos($file, $linkId.".") !== false) {
395
-        $pathinfo = pathinfo($file, PATHINFO_EXTENSION);}}
393
+        foreach ($files as $file) {
394
+        if (strpos($file, $linkId . ".") !== false) {
395
+        $pathinfo = pathinfo($file, PATHINFO_EXTENSION); }}
396 396
         if (isset($pathinfo)) {
397
-        try{File::delete(base_path("assets/favicon/icons")."/".$linkId.".".$pathinfo);} catch (exception $e) {}
397
+        try {File::delete(base_path("assets/favicon/icons") . "/" . $linkId . "." . $pathinfo); } catch (exception $e) {}
398 398
         }
399 399
 
400 400
         return redirect('/studio/links');
@@ -407,11 +407,11 @@  discard block
 block discarded – undo
407 407
 
408 408
         $directory = base_path("assets/favicon/icons");
409 409
         $files = scandir($directory);
410
-        foreach($files as $file) {
411
-        if (strpos($file, $linkId.".") !== false) {
412
-        $pathinfo = pathinfo($file, PATHINFO_EXTENSION);}}
410
+        foreach ($files as $file) {
411
+        if (strpos($file, $linkId . ".") !== false) {
412
+        $pathinfo = pathinfo($file, PATHINFO_EXTENSION); }}
413 413
         if (isset($pathinfo)) {
414
-        try{File::delete(base_path("assets/favicon/icons")."/".$linkId.".".$pathinfo);} catch (exception $e) {}
414
+        try {File::delete(base_path("assets/favicon/icons") . "/" . $linkId . "." . $pathinfo); } catch (exception $e) {}
415 415
         }
416 416
 
417 417
         return redirect('/studio/links');
@@ -535,7 +535,7 @@  discard block
 block discarded – undo
535 535
                 'sometimes',
536 536
                 'max:255',
537 537
                 'string',
538
-                'isunique:users,id,'.$userId,
538
+                'isunique:users,id,' . $userId,
539 539
             ],
540 540
             'name' => 'sometimes|max:255|string',
541 541
             'image' => 'sometimes|image|mimes:jpeg,jpg,png,webp|max:2048', // Max file size: 2MB
@@ -560,7 +560,7 @@  discard block
 block discarded – undo
560 560
         $sharebtn = $request->sharebtn;
561 561
         $tablinks = $request->tablinks;
562 562
 
563
-        if(env('HOME_URL') !== '' && $pageName != $littlelink_name && $littlelink_name == env('HOME_URL')){
563
+        if (env('HOME_URL') !== '' && $pageName != $littlelink_name && $littlelink_name == env('HOME_URL')) {
564 564
             EnvEditor::editKey('HOME_URL', $pageName);
565 565
         }
566 566
     
@@ -794,7 +794,7 @@  discard block
 block discarded – undo
794 794
         // echo Auth::id();
795 795
         $id = $request->id;
796 796
 
797
-    if($id == Auth::id() and $id != "1") {
797
+    if ($id == Auth::id() and $id != "1") {
798 798
 
799 799
         Link::where('user_id', $id)->delete();
800 800
 
@@ -841,7 +841,7 @@  discard block
 block discarded – undo
841 841
         $fileName = "links-$domain-$date.json";
842 842
         $headers = [
843 843
             'Content-Type' => 'application/json',
844
-            'Content-Disposition' => 'attachment; filename="'.$fileName.'"',
844
+            'Content-Disposition' => 'attachment; filename="' . $fileName . '"',
845 845
         ];
846 846
         return response()->json($userData, 200, $headers);
847 847
 
@@ -863,7 +863,7 @@  discard block
 block discarded – undo
863 863
         $userData = $user->toArray();
864 864
         $userData['links'] = $links->toArray();
865 865
 
866
-        if (file_exists(base_path(findAvatar($userId)))){
866
+        if (file_exists(base_path(findAvatar($userId)))) {
867 867
             $imagePath = base_path(findAvatar($userId));
868 868
             $imageData = base64_encode(file_get_contents($imagePath));
869 869
             $userData['image_data'] = $imageData;
@@ -877,7 +877,7 @@  discard block
 block discarded – undo
877 877
         $fileName = "user_data-$domain-$date.json";
878 878
         $headers = [
879 879
             'Content-Type' => 'application/json',
880
-            'Content-Disposition' => 'attachment; filename="'.$fileName.'"',
880
+            'Content-Disposition' => 'attachment; filename="' . $fileName . '"',
881 881
         ];
882 882
         return response()->json($userData, 200, $headers);
883 883
     
Please login to merge, or discard this patch.