violinist-dev / slug-from-url
Get a slug from a URL
Installs: 197 671
Dependents: 2
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires (Dev)
- phpunit/phpunit: ^6.5
- satooshi/php-coveralls: ^2.0
- squizlabs/php_codesniffer: ^3.2
README
Get a slug from a URL
Installation
composer require violinist-dev/slug-from-url
Usage
<?php use Violinist\Slug\Slug; // Probably uou want to use this directly from a URL somehow. Like so: $slug = Slug::createFromUrl('https://github.com/violinist-dev/slug-from-url'); // Maybe you want the github slug: $gh_slug = $slug->getSlug(); // Returns violinist-dev/slug-from-url // Or maybe you want to get the username: $username = $slug->getUserName(); // Returns violinist-dev // ...or here is the repo name. $repo = $slug->getUserRepo(); // Returns slug-from-url
Licence
MIT