christhompsontldr/fluxui-devices
FluxUI front-end for diego-ninja/laravel-devices: manage user devices and active sessions with Livewire Volt. View device details, session locations, and remotely sign out of specific devices or all others. Designed for Laravel Livewire Starter Kit + Flux UI.
A FluxUI front-end for managing devices and sessions using diego-ninja/laravel-devices. Designed to cleanly slot into the Laravel Livewire Starter Kit with Flux UI components.
Inspired by Laravel Jetstream's browser session management, this package provides a beautiful and functional interface for users to manage their authenticated devices and active sessions.
Install and configure diego-ninja/laravel-devices
Install the package via Composer:
composer require christhompsontldr/fluxui-devices
HasDevices trait to your User model:use Ninja\DeviceTracker\Traits\HasDevices;
class User extends Authenticatable
{
use HasDevices;
// ...
}
Note: You can customize the device management route by modifying config('devices.device_route') in your published config/devices.php file.
php artisan vendor:publish --provider="ChrisThompsonTLDR\\FluxuiDevices\\FluxuiDevicesServiceProvider"
Add the device management component to your settings page:
<livewire:fluxui-devices::device-manager />
This component displays:
Add the session management component to your settings page:
<livewire:fluxui-devices::session-manager />
This component displays:
To add these components to the settings page in the Laravel Livewire Starter Kit:
php artisan vendor:publish --provider="ChrisThompsonTLDR\\FluxuiDevices\\FluxuiDevicesServiceProvider"
resources/views/components/settings/layout.blade.php:<flux:navlist.item :href="config('devices.device_route')" wire:navigate>{{ __('Devices') }}</flux:navlist.item>
The route is automatically registered by the package.
To customize the component views:
php artisan vendor:publish --provider="ChrisThompsonTLDR\\FluxuiDevices\\FluxuiDevicesServiceProvider"
The components use an action-message component for success feedback. This component should be available if you're using the Laravel Livewire Starter Kit. If you don't have it, you can create a simple one:
{{-- resources/views/components/action-message.blade.php --}}
@props(['on'])
<div x-data="{ shown: false }"
x-init="@this.on('{{ $on }}', () => { shown = true; setTimeout(() => shown = false, 2000) })"
x-show="shown"
x-transition
{{ $attributes }}>
{{ $slot }}
</div>
Or simply replace <x-action-message on="event-name">Success!</x-action-message> with your own success notification component.
All destructive actions (signing out devices, ending sessions) require the user to confirm their password. This follows the same security pattern used in Livewire Starter Kit.
The MIT License (MIT). Please see License File for more information.
How can I help you explore Laravel packages today?