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

Refactored Student Model to User Model #34

Merged
merged 11 commits into from
Jan 20, 2024
Merged

Conversation

jringeisen
Copy link
Owner

This PR refactors the Student Model to the User Model in order to simplify things and allow for impersonation. Reference the commit messages for more details on what was changed. Resolves #33

Created the seeder to port Students over to the Users table.
Updated the User model.
- Replaced parameter type of Student with User now that a student is a user.
- Removed students from the auth config.
- Created migration to add user_id column to the prompt_questions table.
- Updated login and logout routes.
…need it.

- Updated the StudentController and StudentRequest.
- Updated the StudentPolicy.
- Fixed the motivational message.
Updated the HOME and STUDENT routes in the RouteServiceProvider.
Refactored the student routes to user routes and made necessary changes elsewhere.
- Removed the student resource from nova.
- Updated the User Policy to allow a user to update their own data.
- Added a route for students to be able to update their data.
- Removed Student/Login.vue page as it's no longer needed.
- Timezone is automatically filled in when creating a student now.
- Added and fixed some tests.
- Other small improvements.
@jringeisen jringeisen added the refactor Rewriting a section of code label Jan 19, 2024
@jringeisen jringeisen self-assigned this Jan 19, 2024
@jringeisen jringeisen linked an issue Jan 19, 2024 that may be closed by this pull request
Copy link
Collaborator

@justinwerner justinwerner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, looking good. Just a couple more comments and a couple questions.

- Implemented the isStudent method.
- Updated the UserPolicy so that a parent or a student can view, update, or delete.
@jringeisen jringeisen merged commit 45d8f73 into main Jan 20, 2024
@jringeisen jringeisen deleted the 33-refactor-student-model branch January 20, 2024 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Rewriting a section of code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor Student Model
2 participants