the verification data and the all events are requested by http://xxxx.com/livewire/message/xxxxxx. how to customize this request address?
How to customize Livewire app url?
can you explain a little what you want to achieve?
Hi thank you for reply.
Use Livewire verification data and the all events are requested by http://xxxx.com/livewire/message/xxxxxx. how to customize this request address to http://xxxx.com/xxxxxx? How to remove the livewire/message and use customize url.
Don’t understand what you want to achieve but this way you can return to an URL when some uri is indetify
Route::get('livewire/message/xxxxx', function(){
return redirect()->route('someOtherUrl');
});
Route::get('xxxxxx', [SomeComponent::class])->name('someOtherUrl');
Sorry , I english not good .
you look here please.
http://k.idook.top:8090/Livewire.mp4
i want change http://xxxx.com/livewire/message/xxxxxx to http://xxxx.com/xxxxxx
No need livewire/message/, This is an addition route name is to Livewire automatic add.
But that’s a normal behavior as I can see in my own projects. It’s something related with fetched request from backend, no mean any issue.
Do you mean that this request address cannot be change?
I mean that request response isn’t represent any issue and seem to be a normal behavior of livewire fetched from backend, as you can see in browser inspector all data related to that request
Can change this url or no?
My friend in your web.php file do this and you can see nothing happen
Route::get('livewire/message/login', function (){
dd('yessss');
});
So, you not need do anything with this url
@alimjan Yes, you can however it will require changing the Livewire source code. Start with the LivewireServiceProvider and the registerRoutes function. If Caleb only refers to the named route throughout the source code you might get it to work otherwise you’ll probably just break Livewire altogether. Good luck!
RouteFacade::post('/livewire/message/{name}', HttpConnectionHandler::class)
->name('livewire.message')
->middleware(config('livewire.middleware_group', ''));
Thanks. This is work for me:kissing_heart:
RouteFacade::post(config(config(‘livewire.event_route’, ‘’).’/{name}’, HttpConnectionHandler::class) ->name(‘livewire.message’) ->middleware(config(‘livewire.middleware_group’, ‘’))
LivewireServiceProvider
that is where you should go the make the change in the registerRoutes:
protected function registerRoutes()
{
RouteFacade::domain('{subdomain:domain}.'.config('app.short_url'))->group(function ($subdomain) {
//
RouteFacade::post('/livewire/message/{name}', HttpConnectionHandler::class)
->name('livewire.message')
->middleware(config('livewire.middleware_group', ''));
RouteFacade::post('/livewire/upload-file', [FileUploadHandler::class, 'handle'])
->name('livewire.upload-file')
->middleware(config('livewire.middleware_group', ''));
RouteFacade::get('/livewire/preview-file/{filename}', [FilePreviewHandler::class, 'handle'])
->name('livewire.preview-file')
->middleware(config('livewire.middleware_group', ''));
RouteFacade::get('/livewire/livewire.js', [LivewireJavaScriptAssets::class, 'source']);
RouteFacade::get('/livewire/livewire.js.map', [LivewireJavaScriptAssets::class, 'maps']);
});
}