This is a basic laravel project with authentification scafolding to test new condidates's knowledge, ability to learn and how they tackle challenges.
- PHP installed
- Bruno installed https://www.usebruno.com/ (optional but it will help you)
1- clone the repo
2- run cd refactor
2- run cp .env.example .env
3- run composer i
4- run php artisan key:generate
5- run php aritsan migrate
6- run composer dev
A complete authentication system with these endpoints:
POST /register- User registrationPOST /login- User loginGET /user- Get authenticated userPUT /user- Update user profilePUT /password- Change passwordPOST /logout- Logout current sessionPOST /logout-all- Logout all sessionsGET /tokens- List user tokensDELETE /tokens/{id}- Delete specific tokenDELETE /user- Delete user account
Complete API testing collection with:
- Pre-configured requests for all endpoints
- Automatic token management
- Response validation tests
- Environment configuration
Hint: Use the provided Bruno collection to verify your refactored API works correctly.
- Import the Bruno collection
- Test all endpoints and ensure they work as expected
- Document any issues found and how you resolved them
Objective: Move all route closures to proper controller methods.
Requirements:
- Use laravel Action pattern
- Implement proper validation using Form Requests
- Follow Laravel naming conventions
- Use resource responses where appropriate
Objective: Write http tests for your controllers.
Requirements:
- Create Http tests for all endpoints
- Test both success and failure scenarios
- Use proper test data and assertions
Note: This test is designed to evaluate your practical Laravel skills in a realistic scenario and your ability to learn and to communicate and exmplain your code. Finishing the work is not a strong requirement.