### Install Laravel URL Shortener and Migrate Source: https://github.com/arietimmerman/laravel-url-shortener/blob/master/README.md Installs the Laravel URL Shortener package using Composer and runs database migrations. This is the initial setup step for the package. ```bash composer require arietimmerman/laravel-url-shortener php artisan migrate ``` -------------------------------- ### Docker Commands for URL Shortener Source: https://github.com/arietimmerman/laravel-url-shortener/blob/master/README.md Builds and starts the Docker container for the Laravel URL Shortener, enabling local development and testing. ```bash docker-compose build docker-compose up ``` -------------------------------- ### Publish Package Configuration and Views Source: https://github.com/arietimmerman/laravel-url-shortener/blob/master/README.md Publishes the package's configuration file and views to the application's directories using an Artisan command. This allows for customization. ```php php artisan vendor:publish --provider="ArieTimmerman\Laravel\URLShortener\ServiceProvider" ``` -------------------------------- ### Shorten URL within Docker Container Source: https://github.com/arietimmerman/laravel-url-shortener/blob/master/README.md Executes the Artisan command to shorten a URL from within the running Docker container. This demonstrates using the package in a containerized environment. ```bash docker-compose exec laravel-url-shortener php artisan url:shorten https://www.example.com ``` -------------------------------- ### Shorten URL using Artisan Command Source: https://github.com/arietimmerman/laravel-url-shortener/blob/master/README.md Shortens a given URL using the 'url:shorten' Artisan command. This provides an alternative CLI method for shortening URLs. ```bash php artisan url:shorten http://www.example.com ``` -------------------------------- ### Register URLVisit Event Listener Source: https://github.com/arietimmerman/laravel-url-shortener/blob/master/README.md Registers a listener for the URLVisit event in the application's EventServiceProvider. This allows tracking when a short URL is visited. ```php protected $listen = [ 'ArieTimmerman\Laravel\URLShortener\Events\URLVisit' => [ 'App\Listener\YourListener', ] ]; ``` -------------------------------- ### Shorten URL using Facade Source: https://github.com/arietimmerman/laravel-url-shortener/blob/master/README.md Shortens a given URL using the URLShortener facade. This method directly returns the shortened URL string. ```php (string)URLShortener::shorten("http://www.example.com"); ``` -------------------------------- ### Register Service Provider for Laravel < 5.5 Source: https://github.com/arietimmerman/laravel-url-shortener/blob/master/README.md Registers the URL Shortener service provider in the application's config/app.php file for Laravel versions prior to 5.5. ```php 'providers' => [ /* [..] */ ArieTimmerman\Laravel\URLShortener\ServiceProvider::class /* [..] */ ]; ``` -------------------------------- ### Check URL Redirect via cURL Source: https://github.com/arietimmerman/laravel-url-shortener/blob/master/README.md Checks the redirect functionality of the URL shortener by making a cURL request to a local endpoint. This verifies that shortened URLs are redirecting correctly. ```bash curl -v http://localhost:18123/code ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.