LaravelPackages.net
Acme Inc.
Toggle sidebar
transprime-research/php-url

Urls in PHP made easy

21
2
1.0.2
About transprime-research/php-url

transprime-research/php-url is a Laravel package for urls in php made easy. It currently has 2 GitHub stars and 21 downloads on Packagist (latest version 1.0.2). Install it with composer require transprime-research/php-url. Discover more Laravel packages by transprime-research or browse all Laravel packages to compare alternatives.

Last updated

Build Status Latest Stable Version Total Downloads Latest Unstable Version Latest Monthly Downloads License

About PHP-URL

This works this way

Do it Like a PRO :ok:

Installation

  • composer require transprime-research/php-url

Quick Usage

Use it like this...

$url = new Url(
    fullDomain: 'http://localhost:8080',
    path: '/api/hello',
    query: ['name' => 'John', 'public' => 'yes'],
);

// Or

$url = Url::make(
    scheme: 'http://',
    domain: 'localhost',
    port: '8080',
    path: '/api/hello',
    query: ['name' => 'John', 'public' => 'yes'],
);


(string) $url; // http://localhost:8080/api/hello?name=John&public=yes
$url->toString(); // http://localhost:8080/api/hello?name=John&public=yes

Other Usages

$url = Url::make()
    ->setScheme('http://')
    ->setDomain('localhost')
    ->setPort('8080')
    ->setPath('/api/hello')
    ->addToQuery('name', 'John')
    ->addToQuery('public', 'yes');

(string) $url; // http://localhost:8080/api/hello?name=John&public=yes

Coming Soon

Api implementation to be decided

Additional Information

See other packages in this series here:

  • https://github.com/omitobi/conditional [A smart PHP if...elseif...else statement]
  • https://github.com/transprime-research/piper [A functional PHP pipe in object-oriented way]
  • https://github.com/transprime-research/arrayed [Array now an object]
  • https://github.com/transprime-research/attempt [A smart PHP try...catch statement]
  • https://github.com/omitobi/corbonate [A smart Carbon + Collection package]
  • https://github.com/omitobi/laravel-habitue [Jsonable Http Request(er) package with Collections response]

Similar packages

  • luzzardi/php-url
  • martinmdev/php-url
  • simlux/php-url
  • thesmart/php-url

Licence

MIT (See LICENCE file)

Star History Chart