Add IP test page with Livewire component
Introduces a new route and controller method for '/ip-test', rendering a new view that includes a Livewire component to display the user's IP address. Updates navigation layout for improved profile display. Adds related Blade and Livewire files.
This commit is contained in:
@@ -773,4 +773,9 @@ class MenuController extends Controller
|
||||
|
||||
return response()->json(['success' => true]);
|
||||
}
|
||||
|
||||
public function ip_test()
|
||||
{
|
||||
return view('menu/ip_test');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Livewire;
|
||||
|
||||
use Livewire\Component;
|
||||
use Illuminate\Support\Facades\Request;
|
||||
|
||||
class ShowIpTest extends Component
|
||||
{
|
||||
public function render()
|
||||
{
|
||||
dd($ip = Request::ip());
|
||||
|
||||
return view('livewire.show-ip-test');
|
||||
}
|
||||
}
|
||||
@@ -21,15 +21,24 @@
|
||||
|
||||
<div class="flex-1 overflow-y-auto select-none">
|
||||
<div class="text-center py-4 ms:py-6">
|
||||
<div class="flex items-center justify-center w-full">
|
||||
<a href="{{ route('perfil') }}" class="rounded-full border-2 border-neutral-200 shadow-sm w-10 h-10 overflow-hidden mb-2">
|
||||
@if (Auth::user()->img_perfil)
|
||||
<img src="{{ Auth::user()->img_perfil }}" alt="" class="w-10 h-10 object-contain">
|
||||
@else
|
||||
<img src="https://ui-avatars.com/api/?name={{ Auth::user()->name ?? 'no name' }}" alt="" class="w-10 h-10 object-cover">
|
||||
@endif
|
||||
</a>
|
||||
</div>
|
||||
<div class="relative">
|
||||
<div class="flex items-center justify-center gap-2 w-full">
|
||||
<a href="{{ route('perfil') }}" class="rounded-full border-2 border-neutral-200 shadow-sm w-12 h-12 overflow-hidden mb-2">
|
||||
@if (Auth::user()->img_perfil)
|
||||
<img src="{{ Auth::user()->img_perfil }}" alt="" class="w-12 h-12 object-contain">
|
||||
@else
|
||||
<img src="https://ui-avatars.com/api/?name={{ Auth::user()->name ?? 'no name' }}" alt="" class="w-12 h-12 object-cover">
|
||||
@endif
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<a href="{{ route('perfil') }}">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="text-purple-600 w-6 h-6 absolute -top-0 right-3">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897l8.932-8.931Zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10" />
|
||||
</svg>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="font-medium text-base text-white">{{ Auth::user()->name ?? ''}}</div>
|
||||
<div class="font-medium text-sm text-gray-500">{{ Auth::user()->email ?? ''}}</div>
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
<div>
|
||||
{{-- Close your eyes. Count to one. That is how long forever feels. --}}
|
||||
</div>
|
||||
@@ -0,0 +1,5 @@
|
||||
<x-app-layout>
|
||||
<div class="pb-4">
|
||||
<livewire:show-ip-test />
|
||||
</div>
|
||||
</x-app-layout>
|
||||
@@ -75,6 +75,8 @@ Route::middleware(["auth", "solo_usuario_administrador"])->group(function () {
|
||||
|
||||
Route::post('/registrar-accion-compra', [MenuController::class, 'click_compra'])->name('click_compra');
|
||||
|
||||
Route::get('/ip-test', [MenuController::class, 'ip_test'])->name('ip');
|
||||
|
||||
|
||||
|
||||
require __DIR__ . '/auth.php';
|
||||
|
||||
Reference in New Issue
Block a user