Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/prantomollick/profile-assignment-2-app
This Laravel project sets up a GET route `/my-profile/{id}` linked to `ProfileController`. It stores profile info (`id`, `name`, `age`) in an associative array and creates an `access_token` cookie. The response includes this data and cookie, demonstrating routing, controllers, data handling, and response management.
https://github.com/prantomollick/profile-assignment-2-app
laravel php8
Last synced: about 1 month ago
JSON representation
This Laravel project sets up a GET route `/my-profile/{id}` linked to `ProfileController`. It stores profile info (`id`, `name`, `age`) in an associative array and creates an `access_token` cookie. The response includes this data and cookie, demonstrating routing, controllers, data handling, and response management.
- Host: GitHub
- URL: https://github.com/prantomollick/profile-assignment-2-app
- Owner: prantomollick
- Created: 2024-12-12T07:03:05.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2024-12-12T10:39:07.000Z (about 1 month ago)
- Last Synced: 2024-12-12T11:25:09.123Z (about 1 month ago)
- Topics: laravel, php8
- Language: PHP
- Homepage:
- Size: 75.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Laravel Profile Assignment Project
This Laravel project focuses on creating a simple profile data handler. It sets up a GET route `/my-profile/{id}` that connects to `ProfileController`. The controller has one method, `index`, which receives an `id` parameter and sets the variables `$name` to `"Donald Trump"` and `$age` to `"75"`. It then stores these values in an associative array `$data` along with the `id`.
Additionally, the method creates a cookie named `access_token` with the value `123-XYZ`, sets its lifespan to 1 minute, and specifies other attributes. The response returns the `$data` array with a status code of 200 and includes the created cookie.
### Features
- Laravel framework setup
- Route and controller for profile data
- Associative array for data handling
- Cookie creation and management
- Response handling with status codes### Submission Guidelines
- Submit a GitHub link with a fresh repository containing only Laravel's folders and files.
- Follow the demo structure before submission.Happy coding! 🚀