This week, you'll build an interesting project: a RESTful API for a URL shortener service.
- User Registration
- User Login: Returns an API key using Sanctum.
- URL Shortening:
- Using the API key, users can send a long URL and receive a shortened URL in response.
- If the long URL already exists in the system, the service should return the previous shortened URL instead of creating a new one.
- Only users with a valid API key can use this service.
- Unique Short URLs:
- Ensure all shortened URLs are unique to avoid collisions and unwanted bugs.
- If a user submits the same long URL multiple times, they should receive the same shortened URL for that long URL.
- List Registered URLs: Users can view a list of URLs they have registered via an endpoint.
- URL Redirection: When a shortened URL is accessed in the browser, it should redirect to the original URL (using a simple redirect web route, not an API route).
- Keep All v1 Functionalities
- Visit Count: Track and display the visit count for each short URL.
Clone the repository
git clone https://github.com/jahid32/shortify.git
cd shortify
composer install
php artisan migrate
php artisan serve
Insomnia_2024-11-06.json