// This will return your shortened URL as a string
$shortener->shorten(...);
// This will return a promise which will resolve to your shortened URL
$shortener->shortenAsync(...);
// You can also call shortening from Laravel's url component directly
url()->shorten(...);
// or...
app('url')->shorten(...);
// or even...
app('url.shortener')->shorten(...);
class MyController extends Controller
{
public function myFunction(ShortenerManager $shortener)
{
$shortener->shorten(...);
}
}
public function boot(ShortenerManager $shorteners)
{
$shorteners->extend('my_driver', function ($app, $config) {
// Return your driver instance here
});
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.