Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

Awesome Lists containing this project

README

        

Laravel Logo


Build Status
Total Downloads
Latest Stable Version
License

## 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! 🚀