PHP code example of sharelov / sharelov-shortener

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

    

sharelov / sharelov-shortener example snippets


Sharelov\Shortener\ShortenerServiceProvider::class,

'Shortener'=>Sharelov\Shortener\Facades\Shortener::class,

Route::get('/sh/{hash}',[
    'as'=>'shortener.get',
    'uses'=>'\Sharelov\Shortener\Controllers\LinksController@translateHash'
]);

Route::post('/sh',[
    'as'=>'shortener.store',
    'uses'=>'\Sharelov\Shortener\Controllers\LinksController@store'
]);

Shortener::make($url)

Shortener::getUrlByHash($hash)