Search by

Zero-dependency URL builder/parser for the apiable request grammar (PHP mirror)

Package info

github.com/open-southeners/flex-url-php

Homepage

pkg:composer/open-southeners/flex-url

Statistics

Installs: 105

Dependents: 1

Suggesters: 0

Stars: 0

Open Issues: 0

v3.1.0 2026-09-10 23:09 UTC

This package is auto-updated.

Last update: 2026-09-10 23:11:17 UTC


README

An immutable, fluent URL builder/parser for the Laravel Apiable request-query grammar. Zero runtime dependencies, framework-free.

packagist version required php version Test codecov Edit on VSCode online

Installation

composer require open-southeners/flex-url

Usage

use function flex_url;

flex_url('https://api.example.com/posts')
    ->filter('status', 'published')
    ->sort('-created_at')
    ->include('tags', 'author')
    ->page(1)
    ->toString();
// => "https://api.example.com/posts?filter[status]=published&sort=-created_at&include=tags,author&page[number]=1"

Documentation

Official documentation

TypeScript mirror

A TypeScript core with identical method names/semantics lives alongside this package at packages/js (flex-url on npm). Both implementations are tested against the same shared JSON fixtures so they can't silently drift apart.

License

This package is open-sourced software licensed under the MIT license.