nuewire / users
Livewire user management for Laravel with optional ACL and authentication activity details.
Requires
- php: ^8.2
- illuminate/auth: ^11.0|^12.0|^13.0
- illuminate/console: ^11.0|^12.0|^13.0
- illuminate/contracts: ^11.0|^12.0|^13.0
- illuminate/database: ^11.0|^12.0|^13.0
- illuminate/filesystem: ^11.0|^12.0|^13.0
- illuminate/hashing: ^11.0|^12.0|^13.0
- illuminate/http: ^11.0|^12.0|^13.0
- illuminate/notifications: ^11.0|^12.0|^13.0
- illuminate/pagination: ^11.0|^12.0|^13.0
- illuminate/support: ^11.0|^12.0|^13.0
- illuminate/translation: ^11.0|^12.0|^13.0
- illuminate/validation: ^11.0|^12.0|^13.0
- illuminate/view: ^11.0|^12.0|^13.0
- livewire/livewire: ^3.6|^4.0.3
- nuewire/support: ^1.0
- psr/log: ^1.1|^2.0|^3.0
- rappasoft/laravel-authentication-log: ^6.1
Requires (Dev)
- orchestra/testbench: ^9.0|^10.0|^11.0
- phpunit/phpunit: ^11.0|^12.0
Suggests
- nuewire/acl: Replaces the simple is_admin mode with roles and permissions.
- nuewire/filesystem: Stores avatars using the selected Nuewire filesystem.
- nuewire/platform: Adds Users under Settings > User Management in the Nuewire admin navigation.
- torann/geoip: Adds city, region, country, coordinates, and timezone to authentication activity.
README
Livewire user management with avatars and detailed authentication activity.
Install
composer require nuewire/users
Add the trait:
use Illuminate\Notifications\Notifiable; use Nuewire\Users\Concerns\NuewireUser; class User extends Authenticatable { use Notifiable; use NuewireUser; }
Prepare the database and first administrator:
php artisan nuewire:users:install --migrate --admin=admin@example.com
The migration adds is_admin, avatar_disk, and avatar_path. Its rollback is intentionally non-destructive.
Component
<livewire:nuewire-users />
With nuewire/platform 2, the page is registered under Settings → User Management → Users at /admin/settings/users.
Access modes
Without nuewire/acl, access uses is_admin.
With nuewire/acl, the same page automatically switches to roles, direct permissions, and effective permissions. The route and component stay the same.
Authentication activity
The detail page includes successful and failed attempts, timestamps, IP, user agent, location values, device fingerprint, device name, trusted state, suspicious activity, sessions, statistics, CSV export, device management, and session revocation. Session actions mark authentication-log records as ended; they do not delete host Laravel sessions.
Authentication logging is powered by rappasoft/laravel-authentication-log.
New-device notifications are enabled by Rappasoft by default. Set NEW_DEVICE_NOTIFICATION=false when they are not needed. Schedule authentication-log:purge to enforce the configured retention period.
Optional location support:
composer require torann/geoip
Avatar storage
When nuewire/filesystem is installed, avatars use the active nuewire disk. Otherwise they use public. The original disk and path are stored per user.
Configuration
php artisan vendor:publish --tag=nuewire-users-config
config/nuewire/users.php
Complete setup and permission documentation is available in the suite file docs/USERS_AND_ACL.md.
Privacy
Authentication records can include IP addresses, device identifiers, user agents, and location data. Limit access with ACL permissions and configure retention in config/authentication-log.php.
Random user IDs
NuewireUser includes Nuewire\Support\Concerns\HasRandomIntegerId. New users receive a unique integer ID between 100000000 and 999999999. Existing IDs are not changed.
For a new users table, use a non-incrementing primary key:
$table->unsignedBigInteger('id')->primary();
Do not run an automatic primary-key conversion on an existing production table. Foreign keys and authentication logs must be reviewed first.