@@ -29,7 +29,7 @@ |
||
| 29 | 29 | */ |
| 30 | 30 | public function store(Request $request) |
| 31 | 31 | { |
| 32 | - if (! Auth::guard('web')->validate([ |
|
| 32 | + if (!Auth::guard('web')->validate([ |
|
| 33 | 33 | 'email' => $request->user()->email, |
| 34 | 34 | 'password' => $request->password, |
| 35 | 35 | ])) { |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | // database. Otherwise we will parse the error and return the response. |
| 43 | 43 | $status = Password::reset( |
| 44 | 44 | $request->only('email', 'password', 'password_confirmation', 'token'), |
| 45 | - function ($user) use ($request) { |
|
| 45 | + function($user) use ($request) { |
|
| 46 | 46 | $user->forceFill([ |
| 47 | 47 | 'password' => Hash::make($request->password), |
| 48 | 48 | 'remember_token' => Str::random(60), |
@@ -49,10 +49,10 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | // store |
| 51 | 51 | $LinkType = new LinkType; |
| 52 | - $LinkType->typename = $request->typename; |
|
| 53 | - $LinkType->title = $request->title; |
|
| 52 | + $LinkType->typename = $request->typename; |
|
| 53 | + $LinkType->title = $request->title; |
|
| 54 | 54 | $LinkType->description = $request->description; |
| 55 | - $LinkType->icon = $request->icon; |
|
| 55 | + $LinkType->icon = $request->icon; |
|
| 56 | 56 | $LinkType->params = $request->params; |
| 57 | 57 | $LinkType->save(); |
| 58 | 58 | |
@@ -100,9 +100,9 @@ discard block |
||
| 100 | 100 | |
| 101 | 101 | |
| 102 | 102 | // store |
| 103 | - $linktype->title = $request->title; |
|
| 103 | + $linktype->title = $request->title; |
|
| 104 | 104 | $linktype->description = $request->description; |
| 105 | - $linktype->icon = $request->icon; |
|
| 105 | + $linktype->icon = $request->icon; |
|
| 106 | 106 | $linktype->params = $request->params; |
| 107 | 107 | $linktype->save(); |
| 108 | 108 | |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | { |
| 46 | 46 | $this->ensureIsNotRateLimited(); |
| 47 | 47 | |
| 48 | - if (! Auth::attempt(['email' => $this->email, 'password' => $this->password, 'block' => 'no'] , $this->filled('remember'))) { |
|
| 48 | + if (!Auth::attempt(['email' => $this->email, 'password' => $this->password, 'block' => 'no'], $this->filled('remember'))) { |
|
| 49 | 49 | RateLimiter::hit($this->throttleKey()); |
| 50 | 50 | |
| 51 | 51 | throw ValidationException::withMessages([ |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | */ |
| 66 | 66 | public function ensureIsNotRateLimited() |
| 67 | 67 | { |
| 68 | - if (! RateLimiter::tooManyAttempts($this->throttleKey(), 5)) { |
|
| 68 | + if (!RateLimiter::tooManyAttempts($this->throttleKey(), 5)) { |
|
| 69 | 69 | return; |
| 70 | 70 | } |
| 71 | 71 | |
@@ -88,6 +88,6 @@ discard block |
||
| 88 | 88 | */ |
| 89 | 89 | public function throttleKey() |
| 90 | 90 | { |
| 91 | - return Str::lower($this->input('email')).'|'.$this->ip(); |
|
| 91 | + return Str::lower($this->input('email')) . '|' . $this->ip(); |
|
| 92 | 92 | } |
| 93 | 93 | } |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | */ |
| 15 | 15 | protected function redirectTo($request) |
| 16 | 16 | { |
| 17 | - if (! $request->expectsJson()) { |
|
| 17 | + if (!$request->expectsJson()) { |
|
| 18 | 18 | return route('login'); |
| 19 | 19 | } |
| 20 | 20 | } |
@@ -12,8 +12,8 @@ |
||
| 12 | 12 | { |
| 13 | 13 | public function handle($request, Closure $next) |
| 14 | 14 | { |
| 15 | - if(Schema::hasColumn('users', 'auth_as')) { |
|
| 16 | - $adminUser = User::where('role', 'admin')->where(function ($query) { |
|
| 15 | + if (Schema::hasColumn('users', 'auth_as')) { |
|
| 16 | + $adminUser = User::where('role', 'admin')->where(function($query) { |
|
| 17 | 17 | $query->where('auth_as', '!=', null) |
| 18 | 18 | ->where('auth_as', '!=', ''); |
| 19 | 19 | })->first(); |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | |
| 34 | 34 | |
| 35 | 35 | |
| 36 | - return view('components.pageitems.'.$this->link->typename.'-display', ['link' => $this->link, 'params' => $params]); |
|
| 36 | + return view('components.pageitems.' . $this->link->typename . '-display', ['link' => $this->link, 'params' => $params]); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | public function getModalIdString(): string |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | Column::make(__('messages.Page'), "littlelink_name") |
| 40 | 40 | ->sortable() |
| 41 | 41 | ->searchable() |
| 42 | - ->format(function ($value, $row, Column $column) { |
|
| 42 | + ->format(function($value, $row, Column $column) { |
|
| 43 | 43 | if (!$row->littlelink_name == NULL) { |
| 44 | 44 | return "<a href='" . url('') . "/@" . htmlspecialchars($row->littlelink_name) . "' target='_blank' class='text-info'><i class='bi bi-box-arrow-up-right'></i> " . htmlspecialchars($row->littlelink_name) . " </a>"; |
| 45 | 45 | } else { |
@@ -51,23 +51,23 @@ discard block |
||
| 51 | 51 | ->sortable() |
| 52 | 52 | ->searchable(), |
| 53 | 53 | Column::make(__('messages.Links'), "id") |
| 54 | - ->format(function ($value, $row) { |
|
| 54 | + ->format(function($value, $row) { |
|
| 55 | 55 | $linkCount = Link::where('user_id', $row->id)->count(); |
| 56 | 56 | return $linkCount; |
| 57 | 57 | }), |
| 58 | 58 | Column::make(__('messages.Clicks'), "id") |
| 59 | - ->format(function ($value, $row) { |
|
| 59 | + ->format(function($value, $row) { |
|
| 60 | 60 | $clicksSum = Link::where('user_id', $row->id)->sum('click_number'); |
| 61 | 61 | return $clicksSum; |
| 62 | 62 | }), |
| 63 | 63 | Column::make(__('messages.E-Mail'), "email_verified_at") |
| 64 | 64 | ->sortable() |
| 65 | - ->format(function ($value, $row, Column $column) { |
|
| 65 | + ->format(function($value, $row, Column $column) { |
|
| 66 | 66 | if (env('REGISTER_AUTH') !== 'auth') { |
| 67 | 67 | if ($row->role == 'admin' && $row->email_verified_at != '') { |
| 68 | 68 | return '<div class="text-center">-</div>'; |
| 69 | 69 | } else { |
| 70 | - if($row->email_verified_at == ''){ |
|
| 70 | + if ($row->email_verified_at == '') { |
|
| 71 | 71 | $verifyLinkBool = 'true'; |
| 72 | 72 | } else { |
| 73 | 73 | $verifyLinkBool = 'false'; |
@@ -77,9 +77,9 @@ discard block |
||
| 77 | 77 | 'id' => $row->id |
| 78 | 78 | ]); |
| 79 | 79 | if ($row->email_verified_at == '') { |
| 80 | - return '<div class="text-center"><a style="cursor:pointer" data-id="'.$verifyLink.'" class="user-email text-danger"><span class="badge bg-danger">' . __('messages.Pending') . '</span></a></div>'; |
|
| 80 | + return '<div class="text-center"><a style="cursor:pointer" data-id="' . $verifyLink . '" class="user-email text-danger"><span class="badge bg-danger">' . __('messages.Pending') . '</span></a></div>'; |
|
| 81 | 81 | } else { |
| 82 | - return '<div class="text-center"><a style="cursor:pointer" data-id="'.$verifyLink.'" class="user-email text-danger"><span class="badge bg-success">' . __('messages.Verified') . '</span></a></div>'; |
|
| 82 | + return '<div class="text-center"><a style="cursor:pointer" data-id="' . $verifyLink . '" class="user-email text-danger"><span class="badge bg-success">' . __('messages.Verified') . '</span></a></div>'; |
|
| 83 | 83 | } |
| 84 | 84 | } |
| 85 | 85 | } else { |
@@ -89,15 +89,15 @@ discard block |
||
| 89 | 89 | })->html(), |
| 90 | 90 | Column::make(__('messages.Status'), "block") |
| 91 | 91 | ->sortable() |
| 92 | - ->format(function ($value, $row, Column $column) { |
|
| 92 | + ->format(function($value, $row, Column $column) { |
|
| 93 | 93 | if ($row->role === 'admin' && $row->id === 1) { |
| 94 | 94 | return '<div class="text-center">-</div>'; |
| 95 | 95 | } else { |
| 96 | 96 | $route = route('blockUser', ['block' => $row->block, 'id' => $row->id]); |
| 97 | 97 | if ($row->block === 'yes') { |
| 98 | - $badge = '<div class="text-center"><a style="cursor:pointer" data-id="'.$route.'" class="user-block text-danger"><span class="badge bg-danger">'.__('messages.Pending').'</span></a></div>'; |
|
| 98 | + $badge = '<div class="text-center"><a style="cursor:pointer" data-id="' . $route . '" class="user-block text-danger"><span class="badge bg-danger">' . __('messages.Pending') . '</span></a></div>'; |
|
| 99 | 99 | } elseif ($row->block === 'no') { |
| 100 | - $badge = '<div class="text-center"><a style="cursor:pointer" data-id="'.$route.'" class="user-block text-danger"><span class="badge bg-success">'.__('messages.Approved').'</span></a></div>'; |
|
| 100 | + $badge = '<div class="text-center"><a style="cursor:pointer" data-id="' . $route . '" class="user-block text-danger"><span class="badge bg-success">' . __('messages.Approved') . '</span></a></div>'; |
|
| 101 | 101 | } |
| 102 | 102 | return "<a href=\"$route\">$badge</a>"; |
| 103 | 103 | } |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | ->html(), |
| 106 | 106 | Column::make(__('messages.Created at'), "created_at") |
| 107 | 107 | ->sortable() |
| 108 | - ->format(function ($value) { |
|
| 108 | + ->format(function($value) { |
|
| 109 | 109 | if ($value) { |
| 110 | 110 | return $value->format('d/m/y'); |
| 111 | 111 | } else { |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | }), |
| 115 | 115 | Column::make(__('messages.Last seen'), "updated_at") |
| 116 | 116 | ->sortable() |
| 117 | - ->format(function ($value) { |
|
| 117 | + ->format(function($value) { |
|
| 118 | 118 | $now = now(); |
| 119 | 119 | $diff = $now->diff($value); |
| 120 | 120 | |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | } |
| 130 | 130 | }), |
| 131 | 131 | Column::make(__('messages.Action'), "id") |
| 132 | - ->format(function ($value, $row, Column $column) { |
|
| 132 | + ->format(function($value, $row, Column $column) { |
|
| 133 | 133 | return view('components.table-components.action', ['user' => $row]); |
| 134 | 134 | }), |
| 135 | 135 | ]; |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | function analyzeImageBrightness($file) { |
| 49 | 49 | try { |
| 50 | - $file = base_path('assets/img/background-img/'.$file); |
|
| 50 | + $file = base_path('assets/img/background-img/' . $file); |
|
| 51 | 51 | |
| 52 | 52 | // Get image information using getimagesize |
| 53 | 53 | $imageInfo = getimagesize($file); |
@@ -77,8 +77,8 @@ discard block |
||
| 77 | 77 | |
| 78 | 78 | // Calculate the average brightness of the image |
| 79 | 79 | $total_brightness = 0; |
| 80 | - for ($x=0; $x<$width; $x++) { |
|
| 81 | - for ($y=0; $y<$height; $y++) { |
|
| 80 | + for ($x = 0; $x < $width; $x++) { |
|
| 81 | + for ($y = 0; $y < $height; $y++) { |
|
| 82 | 82 | $rgb = imagecolorat($img, $x, $y); |
| 83 | 83 | $r = ($rgb >> 16) & 0xFF; |
| 84 | 84 | $g = ($rgb >> 8) & 0xFF; |
@@ -132,10 +132,10 @@ discard block |
||
| 132 | 132 | function footer($key) |
| 133 | 133 | { |
| 134 | 134 | $upperStr = strtoupper($key); |
| 135 | - if (env('TITLE_FOOTER_'.$upperStr) == "") { |
|
| 136 | - $title = __('messages.footer.'.$key); |
|
| 135 | + if (env('TITLE_FOOTER_' . $upperStr) == "") { |
|
| 136 | + $title = __('messages.footer.' . $key); |
|
| 137 | 137 | } else { |
| 138 | - $title = env('TITLE_FOOTER_'.$upperStr); |
|
| 138 | + $title = env('TITLE_FOOTER_' . $upperStr); |
|
| 139 | 139 | } |
| 140 | 140 | return $title; |
| 141 | 141 | } |