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

View recently joined users in admin area #905

Merged
merged 9 commits into from
Aug 22, 2024
Merged

View recently joined users in admin area #905

merged 9 commits into from
Aug 22, 2024

Conversation

aneust
Copy link
Contributor

@aneust aneust commented Aug 17, 2024

Introduces a new feature to view a list of users who have joined within the last 7 days.

Added a new route (users/recent) and corresponding controller method (getRecentUsers) to fetch and display users who recently joined.
In view added a "Recently Joined" button in the admin area, which highlights the number of users who joined recently and navigates to the new view.
Created a new Blade template to display the recent users, including account creation date.

Resolves #691

aneust added 4 commits August 17, 2024 13:54
- This button filters and displays users who have recently joined within the last 7 days.
- The button shows a badge with the count of such users.
- This enhancement makes it easier for admins to quickly access and review the most recently joined users.
@aneust aneust requested a review from mzur August 17, 2024 12:54
Copy link
Member

@mzur mzur left a comment

Choose a reason for hiding this comment

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

Thanks!

Please put the search input field first, then the "recently joined button" and then the "new user" button with a pull-right class.

Also, instead of adding a new view, you can filter the list of users in the same view. To do this you can add a query parameter (e.g. recent=1) to the URL. The button URL would then be href="{{route('admin-users-recent')}}?recent=1". In the controller you can get the parameter with $request->get('recent'). If the parameter is true, you can conditionally add a filter to the user query like this:

->when($request->get('recent'), fn ($query) => $query->where('created_at', '>=', now()->subWeek()))

If the user list is filtered, you can add a btn-info class to the "recently joined" button, to make the state clear.

@aneust aneust requested a review from mzur August 21, 2024 18:29
Copy link
Member

@mzur mzur left a comment

Choose a reason for hiding this comment

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

Thanks! I've added a final touch by making the "recent users" button itself btn-info active so there is no need for a separate "x" button. Also the "new user" button is now pull-right.

@mzur mzur merged commit 99bbd57 into master Aug 22, 2024
6 checks passed
@mzur mzur deleted the joinedUsers branch August 22, 2024 06:23
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.

Add "recently joined" view to users list in admin area
2 participants