---
title: "Artisan commands — Safe Fetch for Laravel | Roundly"
description: "safe-fetch:check judges a URL or checks the environment, as text or JSON; php artisan about shows the active policy as counts only."
url: https://roundly-consulting.com/open-source/docs/safe-fetch-for-laravel/commands
language: en
---

[All packages](https://roundly-consulting.com/open-source.md)

[Safe Fetch for Laravel](https://roundly-consulting.com/open-source/docs/safe-fetch-for-laravel.md)

# Artisan commands

## safe-fetch:check {url?} {--http} {--json}

```bash
php artisan safe-fetch:check                                   # the environment
php artisan safe-fetch:check https://hooks.example.com/in      # a URL's verdict under the configured policy
php artisan safe-fetch:check http://hooks.example.com/in --http # allow http for this check only
php artisan safe-fetch:check https://hooks.example.com/in --json
```

- With a URL: the guard’s verdict under the configured policy — Allowed. with the rebuilt URL, every vetted address and the CURLOPT\_RESOLVE entry (or “address literal”), exit 0; or Refused: <reason>. with the rule (blockedBy), exit 1. --http allows http for this check only.
- Without one: the environment — DNS pinning (curl version or unavailable), the pre-send address check (on or off), international host names (ext-intl), the Guzzle version and the configuration (valid or the error). It exits 1 when curl is missing or the configuration is invalid.
- Warnings: http allowed in production, allowed ranges broader than /8 (IPv4, or the IPv4 an IPv6 range carries) or /32 (IPv6), an app.url with no host the guard can read while the app-host block is on, redirects that may drop to http, and a pre-send check that is off.
- It never prints the internal names or ranges you trust.
- \--json prints either as JSON with the same exit codes — for scripts and monitoring.

```json
// a verdict
{"allowed": true, "url": "…", "addresses": ["…"], "pinned_as": "…"}      // pinned_as is null for an address literal
{"allowed": false, "reason": "blocked", "retryable": false, "blocked_by": "private_address"}

// the environment
{"dns_pinning": true, "curl": "…", "pre_send_check": true, "international_host_names": true,
 "guzzle": "…", "configuration_valid": true, "errors": [], "warnings": []}
```

## php artisan about

```bash
php artisan about   # the Safe-fetch section: counts only
```

The package adds a section with counts only — the internal host names and ranges you trust never render:

| Row | Shows |
| --- | --- |
| `Schemes` | https, or http, https. |
| `Ports` | any, or the list. |
| `Allowed hosts` | any, or a count. |
| `Private hosts · Allowed ranges · Blocked ranges` | Counts. |
| `App hosts` | blocked or not blocked. |
| `Redirects` | off, or e.g. 307, 308 · max 3. |
| `DNS pinning` | curl <version> or unavailable. |

## Show your open-source love

This package is free and MIT-licensed. If it saves you time, a one-off donation or a Patreon membership keeps it maintained, tested and documented.

[More ways to support, including crypto](https://roundly-consulting.com/support-us.md)

By donating, you agree to our [donation terms](https://roundly-consulting.com/donation-terms.md).

[Support our open source work (opens in a new tab)](https://donate.stripe.com/dRmeVe8FX5PF1Qd9pXcEw00) [Join us on Patreon (opens in a new tab)](https://www.patreon.com/cw/roundly)

## Want this built into your product?

We integrate our packages into custom Laravel and AI builds. Tell us what you're working on and we'll reply within 48 hours.

[Get a quote in 48 hours](https://roundly-consulting.com/contact.md) [Browse all packages](https://roundly-consulting.com/open-source/docs/safe-fetch-for-laravel.md)
