API: values
Methods that put something on a card. Every method here returns the card, so calls chain, unless it says otherwise. See the API reference for how cards work.
How values are shown
Values become a tree you can open in the viewer: scalars, arrays and objects with their properties and visibility. To keep cards fast and safe:
| Limit | Default | Setting |
|---|---|---|
| Nesting depth | 5 levels | max_depth |
| Items per array or object | 100 | max_items |
| Characters per string | 10,000 | max_string_length |
| Nodes per value | 5,000 | max_nodes |
What is cut off is marked (+40 more). Values under keys named password, password_confirmation, secret, token, api_key, apikey, authorization or cookie (any case) are shown as ***; change the list with redact_keys. Set these in peep.php or config/peep.php (see Configuration).
Some objects are shown more usefully by casters: dates as 2026-10-24 09:15:02.123456 +06:00, exceptions with their message, closures with their signature, and enums as Status::Paid. Laravel adds models and collections (see Laravel methods). An object seen twice in one value is shown once, with a reference after that. Peep never calls your methods to show an object, unless you choose the var-dumper serializer (PEEP_SERIALIZER=var-dumper), which uses Symfony VarDumper's casters.
Integers larger than JavaScript can hold keep every digit, NAN and INF are shown as such, and strings that are not UTF-8 are shown as binary.
send
send(mixed ...$values): PeepShows one or more values on the card. peep($a, $b) calls it for you. Called again on a card that already shows values, it replaces them instead of adding more, so a card can show the latest state:
$progress = peep(0)->label('Progress');
foreach ($batches as $index => $batch) {
$progress->send($index + 1); // the card shows 1, then 2, then 3
}Without values, it does nothing.
pass
pass(mixed $value): mixedShows the value and returns the value, not the card, so you can wrap an expression without changing the code around it:
return peep()->pass($cart->total());
$user = peep()->pass(User::find($id));raw
raw(mixed ...$values): PeepShows values without casters: every object with its properties exactly as stored, without the date, exception, closure, enum or model views. Use it when a caster hides the property you need.
text
text(string $text): PeepShows text as written: spaces, tabs and line breaks are kept, and HTML in it is shown as text, never rendered.
peep()->text($process->getOutput());html
html(string $html): PeepRenders HTML in a sandboxed frame on the card. Scripts in it do not run and it cannot reach the viewer.
json
json(string $json): PeepShows a JSON string pretty-printed. A string that is not valid JSON is shown as it is, grayed out. Use it for a JSON body you already have as text.
toJson
toJson(mixed ...$values): PeepEncodes each value with json_encode() and shows each as JSON, on its own block. Unlike send(), you see exactly what your API would return: JsonSerializable objects use their jsonSerialize(), and private properties are left out. A value that cannot be encoded shows the reason: json_encode() failed: Malformed UTF-8 characters.
peep()->toJson($apiPayload);xml
xml(string $xml): PeepShows an XML string, indented.
table
table(array $rows, ?string $label = null): PeepShows an array as a table. When every item is itself an array or object (a list of rows), each key becomes a column, the first column holds the row's key, and a row without a key has an empty cell. Otherwise it is a two-column table of keys and values. $label is shown above it. The value limits above apply.
peep()->table([
['id' => 1, 'email' => '[email protected]'],
['id' => 2, 'email' => '[email protected]'],
], 'New users');image
image(string $source): PeepShows an image. $source can be:
- a URL:
https://...,http://...or//..., loaded by the viewer; - a data URI:
data:image/png;base64,...; - a file path on the app's machine: read and embedded, up to 5 MB, with the type taken from the extension (
png,jpg,gif,webp,svg,avif,bmp,ico; anything else is sent as PNG); - bare base64 data, taken as PNG.
Anything else, or a file over 5 MB, shows the reason on the card instead of an image.
peep()->image(storage_path('app/avatars/18.png'));file
file(string $path): PeepShows a file's contents, read on the app's machine. Only the first 1 MB is read, and the card says when the file is longer. Files that are not UTF-8 text are sent as binary. The path shown is mapped to your machine like the call site. A missing or unreadable file shows that on the card.
link and url
link(string $url, ?string $label = null): Peep
url(string $url, ?string $label = null): PeepShows a link, with $label as its text when given. The viewer only makes http:, https: and mailto: links clickable; anything else is shown as text. url() is the same method.
peep()->link(route('orders.show', $order), 'Open the order');date
date(mixed $date): PeepShows a date. A DateTimeInterface (including Carbon) is shown to the microsecond with its UTC offset, such as 2026-10-24 09:15:02.123456 +06:00, and opens to its date, timezone name and unix timestamp. Other values are shown as they are; date() is send() with a name that says what you mean.
className
className(object $object): PeepShows the object's fully qualified class name.
invade
invade(object $object): InvaderReturns a helper, not the card: reading a property on it, or calling a method, gives you the private value or the result, and shows it on the card with the label Class::$property or Class::method().
$total = peep()->invade($order)->secretTotal;
$discount = peep()->invade($order)->calculateDiscount(10);It reaches members declared in the object's own class, including private ones; private members of a parent class are not visible this way. The value is returned even while Peep is off.
phpinfo
phpinfo(string ...$keys): PeepWithout arguments, shows a table of the PHP version, SAPI, operating system, loaded php.ini, memory_limit, max_execution_time, error_reporting, display_errors, opcache.enable and the loaded extensions. With setting names, shows only those settings, and (unknown setting) for names PHP does not know.
peep()->phpinfo('memory_limit', 'upload_max_filesize', 'post_max_size');separator
separator(): PeepAdds a divider to the card, to separate groups of values.