Introduces a new rank management system including the Rank model, migrations for the ranks table and user IP address, Livewire components for managing and displaying ranks, and related Blade views. Updates navigation and routes to include the new 'Gestión Rangos' section, and enhances the ShareCodeComponent with user data. Also adds a reusable input field component for forms.
30 lines
510 B
PHP
30 lines
510 B
PHP
<?php
|
|
|
|
namespace App\Http\Livewire;
|
|
|
|
use Livewire\Component;
|
|
use Illuminate\Support\Facades\Auth;
|
|
|
|
class ShowSavingIp extends Component
|
|
{
|
|
public $ip_address;
|
|
|
|
protected $listeners = ['setIpAddress'];
|
|
|
|
public function setIpAddress($ip)
|
|
{
|
|
$this->ip_address = $ip;
|
|
|
|
$user = Auth::user();
|
|
if ($user) {
|
|
$user->ip_address = $ip;
|
|
$user->save();
|
|
}
|
|
}
|
|
|
|
public function render()
|
|
{
|
|
return view('livewire.show-saving-ip');
|
|
}
|
|
}
|