Piper is a Spatie package that brings Laravel-style array and string helpers to PHP 8.5's new pipe operator (`|>`). Unlike Laravel's `Collection` and `Stringable` wrappers, Piper's functions operate directly on native arrays and strings using curried functions designed to sit on the right side of a pipe. The `Arr` namespace provides helpers like `filter`, `map`, `values`, and `join`, while the `Str` namespace covers `lower`, `upper`, `replace`, `prefix`, and more. Because all functions pass native values, array and string steps can be freely mixed in a single pipeline. Install via `composer require spatie/piper` (PHP 8.5 required).

3m read timeFrom laravel-news.com
Post cover image
Table of contents
# Working on plain values# Functions are curried for the pipe# Mixing array and string steps# Installation
1 Comment

Sort: