Skip to content

laravel-ready/url-shortener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

11cb42f Β· Dec 27, 2023

History

84 Commits
May 12, 2023
Oct 29, 2023
Dec 27, 2023
Dec 27, 2023
Mar 15, 2023
Oct 29, 2023
Mar 15, 2023
Nov 2, 2022
Oct 29, 2023
Apr 11, 2023
Oct 22, 2023
Mar 15, 2023

Repository files navigation

UrlShortener

UrlShortener

Stable Version Unstable Version Total Downloads License

πŸ“‚ About

URL shortener for Laravel apps...

πŸ“¦ Installation

Get via composer

composer require laravel-ready/url-shortener

βš™οΈ Configs

php artisan vendor:publish --tag=url-shortener-config

πŸ—οΈ Migrations

# publish migrations
php artisan vendor:publish --tag=url-shortener-migrations

# apply migrations
php artisan migrate --path=/database/migrations/laravel-ready/url-shortener

πŸ“ Usage

use LaravelReady\UrlShortener\Enums\ShortingType;
use LaravelReady\UrlShortener\Supports\UrlShortener;

$shortUrl = UrlShortener::shortUrl(
    'https://github.com/laravel-ready/url-shortener',
    [
        'title' => 'TEST TITLE',
        'description' => 'Lorem ipsum dolar amet',
    ],
    ShortingType::Emoji
);    

CreateShortUrlRequest

To see all validation rules, see the CreateShortUrlRequest class.

use LaravelReady\UrlShortener\Requests\CreateShortUrlRequest;

class ShortUrlController extends Controller
{
    public function store(CreateShortUrlRequest $request)
    {
        $validateData = $request->validated();

        $shortUrl = UrlShortener::shortUrl(
            $validateData['url'],
            $validateData['meta'] ?? [],
            $validateData['type'] ?? ShortingType::Random
        );
    }
}

πŸ”— Postman

You can reach postman examples here.

βš“ Credits

  • This project was generated by the packager.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages