How to do a page refresh after selecting from a dropdown

What seems to be the problem:
I have a master dropdown at the top of my interface allowing me to select the client I want to work with. When changing clients, I would like a full screen refresh to occur so new data can be loaded.
Currently, I can not to as I am unable to do my redirect. I need to be able to get the route the user is currently in I have tried to access the Request and Route Classes without any success

Steps to Reproduce:

Are you using the latest version of Livewire:
yes

Do you have any screenshots or code examples:

livewire

<?php

namespace App\Http\Livewire\Admin;

use App\Models\Client;
use Livewire\Component;
use Illuminate\Support\Facades\Session;

class ClientSelector extends Component
{

    public $clientsList;
    public $client;

    protected $rules = [
        'client' => 'required|numeric',
    ];

    //setup of the component
    public function mount()
    {

        //loads the clients from the DB
        $this->clientsList = Client::orderBy('name','asc')->pluck('name','id')->all();

        //inititalises the client selected
        $this->client = (!empty(Session::get('adminClientSelector'))) ? Session::get('adminClientSelector') : NULL;

    }

    public function updatedClient()
    {

        $validatedData = $this->validate();

        $this->client = $validatedData['client'];

        session()->put('adminClientSelector', $this->client);

     NEED TO ADD REDIRECT HERE. NEEDS TO BE DYNAMIC TO GET THE CURRENT PAGE THE USER IS IN

    }


    public function render()
    {
        return view('livewire.admin.client-selector');
    }
}

blade

<div class="col-xs-12 col-sm-12 col-md-12" wire:ignore>
    <form wire:submit.prevent>
    <div class="form-group">

        <select name="client" id="client" wire:model="client" wire:submit="submit" class="form-control" >
            <option value=''>Choose a client</option>
            @foreach($clientsList as $key => $client)
                <option value="{{ $key }}">{{ $client }}</option>
            @endforeach
        </select>

    </div>
    </form>
</div>

Hey, @Frederico

You can dispatch an event to the frontend to make this happens

    public function updatedClient()
    {

        $validatedData = $this->validate();

        $this->client = $validatedData['client'];

        session()->put('adminClientSelector', $this->client);

      // add this line
     

$this->dispatchBrowserEvent('refresh-page');
    }

And in your blade file

<script>
  window.addEventListener('refresh-page', event => {
     window.location.reload(false); 
  })
</script>

For more info take a look here:

Thanks for that. That’s useful.
I actually figured out the request and routes are available in the mount function and that’s what I am going to use

Good to know @Frederico

Happy coding