Level 1
Solved myself... Add this code to AppServiceProvider::boot()
\Livewire\Livewire::setUpdateRoute(function ($handle) {
return \Illuminate\Support\Facades\Route::post('/livewire/update', $handle)->middleware('admin');
});
Hi. I am trying to implement Pulse to my app, but still getting error "Session store not set on request."
App is divided to two parts - "web" and "admin" (on separate domain). Pulse should be visible only to authenticated admin users. Web is one middleware group and has completely disabled sessions (we dont need them). Admin is also middleware group and has sessions enabled.
Pulse loads on /pulse page and thaks to their gates, its authenticated. Bud it makes requests to /livewire/update, which unfortunately belongs by-default to group web which has sessions disabled.
Is there some way to set middleware for livewire routes?
Solved myself... Add this code to AppServiceProvider::boot()
\Livewire\Livewire::setUpdateRoute(function ($handle) {
return \Illuminate\Support\Facades\Route::post('/livewire/update', $handle)->middleware('admin');
});
Please or to participate in this conversation.