header('Authorization'); if (!$apiKey || !str_starts_with($apiKey, 'Bearer ')) { return response()->json(['message' => 'Unauthorized'], 401); } $token = substr($apiKey, 7); if ($token !== config('ifnex.api_key')) { return response()->json(['message' => 'Forbidden'], 403); } return $next($request); } }