fix: resolve deprecation warnings across the application

This commit is contained in:
xboard
2025-01-26 00:44:58 +08:00
parent 239b970055
commit 2a43a442de
3 changed files with 3 additions and 3 deletions
@@ -94,7 +94,7 @@ class ClientController extends Controller
*/ */
private function isBrowserAccess(Request $request): bool private function isBrowserAccess(Request $request): bool
{ {
$userAgent = strtolower($request->input('flag', $request->header('User-Agent'))); $userAgent = strtolower($request->input('flag', $request->header('User-Agent', '')));
return str_contains($userAgent, 'mozilla') return str_contains($userAgent, 'mozilla')
|| str_contains($userAgent, 'chrome') || str_contains($userAgent, 'chrome')
|| str_contains($userAgent, 'safari') || str_contains($userAgent, 'safari')
+1 -1
View File
@@ -19,7 +19,7 @@ class Coupon extends Model
public function getLimitPeriodAttribute($value) public function getLimitPeriodAttribute($value)
{ {
return collect(json_decode($value, true))->map(function ($item) { return collect(json_decode((string) $value, true))->map(function ($item) {
return PlanService::getPeriodKey($item); return PlanService::getPeriodKey($item);
})->toArray(); })->toArray();
} }
+1 -1
View File
@@ -90,7 +90,7 @@ class Helper
return true; return true;
} }
public static function trafficConvert(int $byte) public static function trafficConvert(float $byte)
{ {
$kb = 1024; $kb = 1024;
$mb = 1048576; $mb = 1048576;