Manage Users

The user management system allows administrators to view, edit, and manage user accounts through a simple interface.

User Listing

User Listing table

The users table is available at /admin/users and provides:

  • Search functionality to find users by name or email
  • Sorting by creation date
  • Pagination (6 users per page)
  • Display of user roles and subscription status

The table is powered by the Admin\Users\UsersTable Livewire component.

User Detail Page

User Detail Page

Each user has a detail page at /admin/users/{user} where you can:

  • Edit user information (name, email, phone, address)
  • Manage roles and permissions
  • Block or unblock users
  • Delete user accounts
  • View subscriptions, orders, and transactions

Components

UsersTable

Displays a paginated, searchable table of users with their roles and subscription information.

Location: App\Livewire\Admin\Users\UsersTable

ManageUserRoles

Allows assigning and removing roles from users. Roles are selected from a dropdown that only shows unassigned roles.

Location: App\Livewire\Admin\Users\ManageUserRoles

BlockUser

Toggles the blocked status of a user by assigning or removing the 'blocked' role. Blocked users cannot log in.

Location: App\Livewire\Admin\Users\BlockUser

DeleteUser

Permanently deletes a user account. Automatically cancels any active subscriptions before deletion.

Location: App\Livewire\Admin\Users\DeleteUser

Related Routes

Method Path Route name
GET /admin/users admin.users.index
GET /admin/users/{user} admin.users.show

References

Category Path / Name Description
Routes GET /admin/users (admin.users.index) Admin users listing page
Routes GET /admin/users/{user} (admin.users.show) User detail page
Controller App\Http\Controllers\Admin\UserController Controller handling user listing and detail pages
Livewire App\Livewire\Admin\Users\UsersTable Component for displaying paginated, searchable users table
Livewire App\Livewire\Admin\Users\ManageUserRoles Component for managing user roles (assign/remove)
Livewire App\Livewire\Admin\Users\BlockUser Component for blocking/unblocking users
Livewire App\Livewire\Admin\Users\DeleteUser Component for deleting user accounts
Model App\Models\User User model with Spatie HasRoles trait
Views pages/admin/users/index.blade.php Admin users listing page
Views pages/admin/users/show.blade.php User detail page with all management components