wip change bettype in events monitor
This commit is contained in:
1 parent
245255756c
commit
c6fd66189b
15 files changed
+255
-279
No files matched your search
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire;
|
||||
|
||||
use App\Models\Client;
|
||||
use App\Models\User;
|
||||
use Livewire\Component;
|
||||
|
||||
class ClientSwitch extends Component
|
||||
{
|
||||
public $clients = [];
|
||||
|
||||
public ?string $client = '';
|
||||
|
||||
public function mount()
|
||||
{
|
||||
$this->clients = Client::pluck('name', 'id')->all();
|
||||
|
||||
$this->client = Client::where('id', auth()->user()->client_id)->pluck('name')->first();
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.client-switch');
|
||||
}
|
||||
|
||||
public function swop($client_id)
|
||||
{
|
||||
User::where('id', auth()->user()->id)->update(['client_id' => $client_id]);
|
||||
|
||||
$this->js('window.location.reload()');
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user