Skip to content

Commit

Permalink
Update readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
jstoone committed Jul 21, 2020
1 parent cba95ea commit 6e59181
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,12 @@ Let's say you have your own little URL-shortener, and each of the user submitted

## Usage
```php
$slugger = new Darkshare\Slugger();
// Transform ID's to slugs.
Darkshare\Slugger::encode(1); // a
Darkshare\Slugger::encode(81259151); // fUcod

// encode id's
$slugger->encode(1); // a
$slugger->encode(81259151); // fUcod

// decode id's
$slugger->decode('a'); // 1
$slugger->decode('fUcod'); // 81259151
// Transform slugs to IDs.
Darkshare\Slugger::decode('a'); // 1
Darkshare\Slugger::decode('fUcod'); // 81259151
```

0 comments on commit 6e59181

Please sign in to comment.