d0ggy/lara-slim-url

0.1.0-alpha 2022-06-21 06:39 UTC

This package is auto-updated.

Last update: 2024-09-10 09:13:00 UTC


README

Build Status Packagist Downloads Packagist License StyleCI Packagist Version

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.