d0ggy / lara-slim-url
easy slim url
0.1.0-alpha
2022-06-21 06:39 UTC
Requires
- php: >=7.0.0
Requires (Dev)
- laravel/laravel: >=5.5
- orchestra/testbench: ^3.5.0
- phpunit/phpunit: ~6.0
- squizlabs/php_codesniffer: *
This package is auto-updated.
Last update: 2024-09-10 09:13:00 UTC
README
Introduction
A Laravel package to shorten your url.
Requirements
- PHP 7.0+
- Laravel >= 5.5.0
Installing
Add the dependency to your project:
composer require d0ggy/lara-slim-url
Then publish resources using the vendor:publish
command:
php artisan vendor:publish --provider="D0ggy\LaraSlimUrl\SlimUrlServiceProvider"
Next, you should migrate your database:
php artisan migrate
Usage
<?php use D0ggy\LaraSlimUrl\Facades\SlimUrl; $url = 'http://www.emard.org/harum-laborum-omnis-molestias-qui-tempora-iusto-est-maxime'; $path = SlimUrl::getSlimUrlPath($url); echo url($path);die(0);
Open http://localhost/s/{$path}
in browser, you will be redirect to $url
.