Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: change code for improved readability and maintainability #7

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

ILopesjr
Copy link

No description provided.

ILopesjr added 11 commits July 29, 2024 11:02
- Corrected the port mentioned for accessing the application
- Improved the clarity and consistency of the instructions
- Ensured correct and consistent formatting
- Added comments to explain each target.
- Grouped related targets together for better readability.
- Used variables for repeated values like `docker-compose` and `php artisan` commands.
- Added `.PHONY` targets to avoid conflicts with files of the same name.
- Changed permissions in `fix-permissions` target to 755 for directories and 644 for files to enhance security.
- Separated commands in `api-passport-generate` target to avoid execution errors.
- Added type hints for method parameters and return types.
- Used dependency injection for the `User` model.
- Moved validation logic to `StoreUserRequest` and `UpdateUserRequest` classes.
- Ensured proper HTTP status codes and responses.
- Added Swagger annotations for API documentation.
- Removed unnecessary `@var` annotations for properties already defined in the class.
- Ensured proper use of `protected` or `public` visibility for properties.
- Added missing relationships.
- Ensured proper use of `Carbon` for date attributes.
- Added Swagger annotations for API documentation.
- Added `authorize` method to always return `true`.
- Defined validation rules for `name`, `email`, and `password` fields.
- Added `authorize` method to always return `true`.
- Defined validation rules for `name`, `email`, and `password` fields.
- Executed `php artisan l5-swagger:generate` to update the API documentation.
- Ensured that the latest changes are reflected in the Swagger docs.
fix: update User model to use Laravel Passport for API tokens

- Added `use Laravel\Passport\HasApiTokens;` to the User model.
fix: update UserTableSeeder to avoid direct bcrypt usage

- Modified UserTableSeeder to set plain password, which will be hashed automatically by the User model.
…tication

- Set the `driver` for the `api` guard to `passport`.
- Configured the `provider` for the `api` guard to `users`.
- Set `hash` to `false` for the `api` guard.
- Add `L5_SWAGGER_USE_ABSOLUTE_PATH` set to `true`.
- Add `L5_FORMAT_TO_USE_FOR_DOCS` set to `json`.
- Add `L5_SWAGGER_GENERATE_ALWAYS` set to `true`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant