Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Ping Laravel Package

acamposm/ping

A simple Laravel package for pinging hosts and checking connectivity. It wraps ping commands behind a clean API, making it easy to test server availability, measure response, and integrate uptime checks into your Laravel apps.

View on GitHub
Deep Wiki
Context7

acamposm/ping is a lightweight Laravel/PHP package for checking whether hosts are reachable via ICMP ping. It wraps the platform’s native ping command behind a clean API, making it easy to verify connectivity to domains or IP addresses from your application, scheduled tasks, or health checks.

  • Simple Ping API/facade for host reachability checks
  • Supports domain names and IP addresses
  • Configurable timeout and ping attempts
  • Seamless Laravel integration via service provider and facade
  • Ideal for monitoring, health checks, and connectivity validation
Frequently asked questions about Ping
How do I install acamposm/ping in a Laravel application?
Install it with Composer using composer require acamposm/ping, then confirm the package's service provider and facade alias are discovered or registered for your Laravel version. Once installed you can call the facade from a service class, an artisan command, or a queued job. Before relying on it, check that the Composer constraints match your PHP and Laravel versions, since the package has not had a release since December 2021.
Does acamposm/ping support PHP 8.2, PHP 8.3 and Laravel 10 or 11?
The package has not shipped a release since December 2021, so support for PHP 8.2/8.3 and Laravel 10/11 is not guaranteed. Read the requirements block in its composer.json and run a throwaway install against your exact stack before committing to it. If the constraints block installation, treat that as a signal to fork the package or use an alternative rather than forcing it with ignore-platform-reqs.
Does acamposm/ping use raw sockets or shell out to the ping binary?
Based on its description, it is a thin facade around the native operating system ping command, so it shells out rather than using raw sockets or a PHP extension. That means the ping binary must exist on the host and the PHP process must be allowed to execute it. Verify the actual implementation and the flags it emits in your own environment, because the exact command details are not documented in the available material.
Why does acamposm/ping always fail inside Docker or a container?
Most container failures come from a missing ping utility, a non-root user without the required socket capability, or ICMP being blocked by network policy. Install the ping package in your base image, confirm that process execution is permitted, and check that outbound ICMP is allowed on the network. Shared hosting and restricted PaaS platforms often block ICMP entirely, in which case you should fall back to an HTTP health check.
Is acamposm/ping safe from command injection when pinging user-supplied hostnames?
Any package that shells out to ping has to escape its arguments, and you should not assume this one does. Validate input yourself with a strict hostname or IP allowlist pattern using Laravel's validator, and never concatenate raw user input into a shell string. Pass the host as a single escaped argument, and reject anything containing spaces, semicolons, pipes, or backticks.
Should I call acamposm/ping from a controller or a queued job?
Ping is blocking I/O and can take seconds or hang until it times out, so avoid calling it synchronously in user-facing request paths. Prefer a queued job, a scheduled command, an admin-only diagnostics page, or a deployment smoke check. Wrapping it in an application-owned interface keeps the rest of your code from depending on this package directly.
How do I control timeouts, packet counts and IPv4 versus IPv6 with this package?
The configuration surface is not documented in the overview, so inspect the package config and source for timeout, packet count, and address family options before relying on defaults. Regardless of defaults, enforce your own timeout at the call site and rate-limit repeated checks. Test IPv6 behaviour separately, because many ping invocations default to IPv4 or fail quietly on hosts without v6 routing.
What does acamposm/ping return on DNS failure versus a timeout versus a permission error?
These failure modes can all surface as a false return or as an exception depending on how the package parses command output, so they are worth testing individually. A missing binary or insufficient permissions usually leaks through as a process exception, while DNS failure and ICMP filtering may look identical to a timeout. Distinguishing them matters if you plan to alert on the result, because blocked ICMP produces false negatives that look like downtime.
Is acamposm/ping still maintained, and what are the better alternatives?
The package has low adoption, no dependents, and no release since December 2021, so expect to own compatibility fixes and security review yourself. Pin the version and monitor advisories rather than pulling it in loosely. Alternatives include wrapping Symfony Process around ping directly, calling an HTTP health endpoint, or using a managed monitoring probe, all of which are easy to swap in if you keep an adapter boundary.
How do I test acamposm/ping and mock it in Laravel tests?
Mock the facade, or better, inject your own small reachability contract and bind a fake implementation in the container so unit tests never execute ping. Cover success, timeout, DNS failure, and ICMP-blocked cases explicitly. Tests that really ping a host should live in a separate group and run only in a known environment where the binary is installed and outbound ICMP is allowed.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
abbasudo/artisan-route
mirvan/ippanel
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package