An open API service indexing awesome lists of open source software.

https://github.com/violinist-dev/slug-from-url

Get a slug from a URL
https://github.com/violinist-dev/slug-from-url

Last synced: about 1 year ago
JSON representation

Get a slug from a URL

Awesome Lists containing this project

README

          

# slug-from-url
Get a slug from a URL

[![Coverage Status](https://coveralls.io/repos/github/violinist-dev/slug-from-url/badge.svg)](https://coveralls.io/github/violinist-dev/slug-from-url)
[![Build Status](https://travis-ci.org/violinist-dev/slug-from-url.svg?branch=master)](https://travis-ci.org/violinist-dev/slug-from-url)
[![Violinist enabled](https://img.shields.io/badge/violinist-enabled-brightgreen.svg)](https://violinist.io)

## Installation

```
composer require violinist-dev/slug-from-url
```

## Usage

```php
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