PHP code example of cuneytsenturk / laravel-url-shortener
1. Go to this page and download the library: Download cuneytsenturk/laravel-url-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/ */
cuneytsenturk / laravel-url-shortener example snippets
'UrlShortener' => CuneytSenturk\UrlShortener\Facade::class,
use Cuneytsenturk\UrlShortener\Facade;
$shortUrl = UrlShortener::encode('https://example.com/very/long/url');
echo $shortUrl;
use Cuneytsenturk\UrlShortener\Facade;
$originalUrl = UrlShortener::decode($shortUrl);
echo $originalUrl;
bash
php artisan vendor:publish --provider="CuneytSenturk\UrlShortener\Provider"
bash
php artisan migrate