An immutable, fluent URL builder/parser for the Laravel Apiable request-query grammar. Zero runtime dependencies, framework-free.
composer require open-southeners/flex-urluse 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"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.
This package is open-sourced software licensed under the MIT license.