Skip to content
On this page

URL Shortener v0.1.1


Oupss...

Offline... Sorry but this project is not available.

Github

This project is open-source and available on a Github repository, accessible here.

Presentation

Simple URL Shortener (inspired by bitly) 🔗

I use Laravel for the backend of the application, and React for the frontend.

He's based on the same operating principle as bitly. You give the URL you would like to shorten. The application takes care of everything and return you a beautiful link.

For example :

php
$link = "https://alxishenry.github.io/docs/guide/projects/url-shortener";
$slug = Slug::new(); // A23n4b0s

$short = Short::create([
	"slug" => $slug,
	"url" => $link,
	"user_id" => Auth::user()->id,
	"expires" => now()->addYears(5)
]);

/**
 * Now, if you try to access to the given url
 * - https://example.com/$slug
 * You will be redirected to the url corresponding to this slug.
 * 
 * @param Short $short
 * 
 * @return \Illuminate\Http\Response
 */
public function show(Short $short)
{
  return redirect()->away($short->url);
}

Contributors

MIT Licensed