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

Visit Laravel Package

spatie/visit

Human-friendly curl for the terminal. Visit any URL and display its response with colorized output (HTML via bat, JSON via jq), plus status code and response time. Supports custom HTTP methods and options like following redirects.

View on GitHub
Deep Wiki
Context7

See the response of any URL in a beautiful way

Frequently asked questions about Visit
How do I install spatie/visit for Laravel projects?
Run `composer global require spatie/visit` to install globally. For Laravel-specific usage, install via `composer require spatie/visit` in your project. Ensure you have `bat` (for HTML) and `jq` (for JSON) installed for colorized output.
Can I use spatie/visit to scrape dynamic JavaScript-rendered content?
No, spatie/visit fetches static HTML/JSON. For dynamic content, pair it with `spatie/laravel-headless-chrome` or use Playwright/Puppeteer. Example: `$visit->withHeadlessBrowser()->html()`.
What Laravel versions does spatie/visit support?
Officially tested on Laravel 10/11 (PHP 8.1+). Laravel 9 may work but isn’t guaranteed. Check the [GitHub issues](https://github.com/spatie/visit/issues) for version-specific fixes.
How do I customize HTTP headers or timeouts in Laravel?
Configure via `config/visit.php`. Example: `'timeout' => 30, 'headers' => ['User-Agent' => 'MyApp/1.0']`. Override defaults in your `AppServiceProvider` using `Visit::configure()`.
Is spatie/visit thread-safe for concurrent requests?
Yes, it’s stateless and designed for concurrent use. For high-volume scraping, queue requests with Laravel Queues (`Visit::queue()`) to avoid rate limits or timeouts.
How do I mock spatie/visit for unit tests?
Use Laravel’s HTTP client mocking. Example: `Visit::shouldReceive('url')->andReturn(new VisitResponse($html, 200));`. The package’s Guzzle-based client is easily replaceable.
What’s the difference between `visit` CLI and the Laravel package?
The CLI (`visit <url>`) is a standalone tool. The Laravel package adds integration with Laravel’s HTTP client, config system, and service container for programmatic use (e.g., `Visit::url('...')->html()`).
How do I handle redirects with spatie/visit?
By default, it follows redirects. Disable with `--no-follow` or configure globally in `config/visit.php` with `'follow_redirects' => false`. Track redirects via `$visit->getRedirects()`.
Can I use spatie/visit in Laravel queues for async processing?
Yes. Dispatch a job with `Visit::queue('https://example.com')`. Use `spatie/queueable-middleware` for retries or `Laravel Horizon` to monitor long-running visits.
What are the alternatives to spatie/visit for Laravel?
For static content: Laravel’s built-in `Http::get()` or Guzzle middleware. For dynamic content: Playwright/Puppeteer. For full scraping: Symfony Panther. spatie/visit excels for quick, human-readable CLI/terminal use.
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