PHP code example of danielebuso / shortener

1. Go to this page and download the library: Download danielebuso/shortener 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/ */

    

danielebuso / shortener example snippets

 bash
php artisan vendor:publish --tag=migrations
php artisan migrate
 php
Route::domain('mylink.com')->group(function () {
    Route::get('{short_link}', 'ShortLinkController@resolve')->name('short_link');
});

// Then in controller
$short_link->short_url // Eg. https://mylink.com/JedO8TSC
 bash
php artisan vendor:publish --tag=config