The modern, privacy-aware URL Shortener built in Laravel & PHP.
- E-mail: [email protected]
- Password: admin123
- URL shortener transforming long, ugly links into nice, memorable and trackable short URLs.
- All links can be shortened with or without membership.
- Public & Private links (private: only the desired emails can access the real URL)
- Membership is required for some API calls and further link operations.
- Profile settings page where name, password and API key changes can be made.
- Dashboard of links and statistics page with information about people who visited the shortened link.
- Admin panel where all members and links can be viewed and edited.
- Validation of all form fields & API calls.
- and more...
- Homepage(URL Shortener)
- Login/Register/Logout Page
- Profile Settings Page
- API Section
- Dashboard Page
- Stats Page
- Admin Panel
Make sure you've installed Composer
-
Open the folder with any editor
-
Open
.env
and put your database details into it -
Write these lines to editor's terminal or default terminal of your system (make sure you're inside of the folder)
"php artisan migrate"
"php artisan db:seed"
"php artisan serve"
-
That's it, you're ready to use it. Visit:
http://127.0.0.1:8000
The API has 2 endpoints. You can create a new link through the API or request details of existing links. Membership required for some calls.(to create a new link or to fetch the details of link which belongs to user) API token can be generated from the settings page after logging in.
You must be a member to create a new link via API.
POST /api/links
Parameter | Type | Description |
---|---|---|
API_token |
string |
Required |
url |
string |
Required |
private |
boolean |
Required |
email |
string |
Required if private is true. |
Response
{
"error": false,
"link": {
"user_id": "1",
"email": [
"[email protected]"
],
"short_path": "3QTrbH0",
"url": "https://github.com/BerkanYesilyurt",
"private": "1",
"created_at": "13-08-2022 15:38:33"
}
}
Details of all links that do not belong to any user can be viewed. If you want to see the details of the user's link, you must call with that user's API token.
GET /api/links/{short_path}
Parameter | Type | Description |
---|---|---|
API_token |
string |
Required if link belongs a user |
Response
{
"error": false,
"link": {
"user_id": null,
"email": [
"[email protected]"
],
"short_path": "H1BqIN5",
"url": "https://github.com/BerkanYesilyurt",
"private": 1,
"created_at": "13-08-2022 15:12:37"
}
}
Invalid Request's Response (404)
{
"error": "Incorrect request!"
}
Click on the pictures for the original resolution.
Berkan Yeşilyurt
[email protected]