PHP code example of orlovtech / short-link

1. Go to this page and download the library: Download orlovtech/short-link library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

orlovtech / short-link example snippets


ShortLink::generate('https://yourlink.com');

ShortLink::generate(
    'https://yourlink.com',
    singleUse: true,
);

$link = ShortLink::generate('https://yourlink.com');

echo config('app.url') . $link->default_short_url;
bash
php artisan vendor:publish --provider="OrlovTech\ShortLink\Providers\ShortLinkServiceProvider"
bash
php artisan migrate