Weave Code
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
Http Status Check

Http Status Check Laravel Package

spatie/http-status-check

CLI tool to crawl a website and report HTTP status codes for every link. Scan internal and optionally external URLs, control concurrency for speed, and export failing (non-2xx/3xx) links to a file for quick auditing.

View on GitHub
Deep Wiki
Context7

CLI tool to crawl a website and check HTTP status codes

Frequently asked questions about Http Status Check
How do I integrate spatie/http-status-check into a Laravel project for automated pre-deployment link validation?
Wrap the CLI tool in a custom Artisan command (e.g., `php artisan check:links`) and schedule it via Laravel’s scheduler. Use the `spatie/laravel-schedule` package to run checks daily or before deployments. For large sites, batch processing with Laravel queues (e.g., `spatie/queueable`) is recommended to avoid timeouts.
Can this package check API endpoints or authenticated routes in a Laravel app?
Yes, extend the `StatusCheck` class to include headers (e.g., `StatusCheck::withHeaders(['Authorization' => 'Bearer token'])`). For API routes, exclude dynamic paths (e.g., `/api/user/{id}`) via regex in the config. Test with Laravel’s `HttpClient` facade to mock responses in unit tests.
What Laravel versions does spatie/http-status-check support, and are there breaking changes?
The package is framework-agnostic but works with Laravel 8+ (PHP 7.4+). No Laravel-specific dependencies exist, so version compatibility is tied to Symfony HTTP Client (v5+). Check the [README](https://github.com/spatie/http-status-check) for Symfony updates, as they may require minor adjustments to your wrapper code.
How do I store historical results in a Laravel database for trend analysis?
Output results to JSON/CSV and import them into a `status_checks` table with columns like `url`, `status_code`, `checked_at`, and `is_broken`. Use Laravel’s `queue:work` to process batches asynchronously. For analytics, query with Eloquent or use Laravel Scout for full-text search on broken links.
Is there a way to parallelize checks for large Laravel applications with 10K+ links?
Yes, use the `--concurrency` flag (e.g., `--concurrency=50`) to control parallel requests. For Laravel, combine this with queue workers: dispatch jobs per route group (e.g., `check:links:batch --urls=admin/*`) and process them in parallel using `spatie/queueable` or Laravel’s `dispatchSync()` for smaller batches.
How do I exclude dynamic routes (e.g., SPAs, GraphQL) or internal Laravel paths from checks?
Configure exclusions via the `StatusCheck` class or CLI flags. For example, exclude `/api/*` or `/admin/*` by passing `--exclude=/api/,/admin/` to the CLI. In a Laravel wrapper, use `StatusCheck::withExcludedUrls()` with regex patterns like `~^(?!/api/).*$~` to filter dynamic routes.
Can I trigger Slack alerts or Jira tickets when broken links are detected in Laravel?
Yes, parse the output (JSON/CSV) in a Laravel event listener or scheduled task. Use `spatie/laravel-notification-channels-slack` to send alerts, or integrate with Jira’s API via Guzzle. For example, loop through failed checks and dispatch `NotifyAdmins` notifications with the broken URLs.
What are the alternatives to spatie/http-status-check for Laravel, and when should I use them?
For Laravel-specific tools, consider `laravel-debugbar` (basic link checking) or `beberlei/assert` for assertions. For enterprise needs, use Screaming Frog API or paid services like Pingdom. Choose this package if you need a lightweight, CLI-driven solution with Laravel integration (e.g., queues, Artisan) and custom output formats.
How do I test spatie/http-status-check in a Laravel CI pipeline (e.g., GitHub Actions) to fail builds on broken links?
Add a step to your workflow (e.g., `php artisan check:links --output=results.json`) and validate the JSON output with a script. Use `jq` to filter failed status codes (e.g., `jq '.[] | select(.status != 200)' results.json`) and set `exit 1` if any are found. Example: `if [ $(jq '.[] | select(.status != 200) | length' results.json) -gt 0 ]; then exit 1; fi`.
The package is archived—will it break with future PHP/Symfony updates? How can I mitigate risks?
Fork the repository or wrap it in a custom Composer package to isolate dependencies. Monitor Symfony HTTP Client updates and test compatibility. For critical projects, pin the `spatie/http-status-check` version in `composer.json` and override core classes (e.g., `StatusCheck`) to handle deprecations. Consider contributing fixes to the original repo if issues arise.
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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport