Skip to content

About

Zero-dependency URL builder/parser for the apiable request grammar (PHP mirror) — read-only split of open-southeners/flex-url, pushed by CI. Do not commit here directly.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

29 Commits

Folders and files

Repository files navigation

open-southeners/flex-url

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.

About

Zero-dependency URL builder/parser for the apiable request grammar (PHP mirror) — read-only split of open-southeners/flex-url, pushed by CI. Do not commit here directly.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages