Introduces ShowSavingIp Livewire component to fetch, display, and save the authenticated user's IP address. Integrates the component into the navigation layout and comments out the unused /ip-test route.
24 lines
609 B
PHP
24 lines
609 B
PHP
<div
|
|
x-data="{
|
|
getIp() {
|
|
fetch('https://api.ipify.org/?format=json')
|
|
.then(res => res.json())
|
|
.then(data => {
|
|
$wire.emit('setIpAddress', data.ip);
|
|
})
|
|
.catch(err => console.error('Error obteniendo IP:', err));
|
|
}
|
|
}"
|
|
x-init="getIp()"
|
|
wire:poll.visible.delay.600000ms
|
|
class="py-4"
|
|
>
|
|
<p class="text-sm text-gray-600">
|
|
@if($ip_address)
|
|
Tu IP actual: <strong>{{ $ip_address }}</strong>
|
|
@else
|
|
Obteniendo IP...
|
|
@endif
|
|
</p>
|
|
</div>
|