Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Mohammedkichu's avatar

Redirecting from blade page while clicking on a button to another blade page

I was wondering that , is that possible to redirect a view page after clicking the button from another component blade view file,it is working for me like if i give <livewire:component name>in my main layout and if i directly call through my route and try to trigger the button it is not working

0 likes
7 replies
tykus's avatar

Why is a regular anchor <a> not the solution here?

Mohammedkichu's avatar

yes it is working on a regular anchor but i am trying to do this with a fully livewire functionality currently in my blade file i redirect by using Go to create Component in which creating is a simple function it will just redirect to the create.

tykus's avatar

@Mohammedkichu why does Livewire need to be involved in this case? I am no clearer why you need a GoToCreate component.

Mohammedkichu's avatar

ok sorry for that, i am trying to create a laravel-livewire crud in which <button wire:click="creating"> Go to create component </button> in this the wire:click is not rendering to the route or function "creating"

tykus's avatar

@Mohammedkichu I still can't understand your insistence on using Livewire here... what exactly is the structure of this application in respect of these components?

Mohammedkichu's avatar

i have converted my normal component to livewire components for getting dynamic and while converting to laravel:livewire i found this type of error nothing much ,can you just get me an idea for normal livewire function to render to another blade view page while triggering a button

Beiri's avatar

On the livewire documentation shows that you can use a anchor tag with wire:navigate property

<nav>
    <a href="/" wire:navigate>Dashboard</a>
    <a href="/posts" wire:navigate>Posts</a>
    <a href="/users" wire:navigate>Users</a>
</nav>

If you want to use a button for some kind of accessibility reason I would sugggest you to add the role="button" property on the links, like so:

<a href="/" wire:navigate role="button">Dashboard</a>

You can find more information about the role attribute here:

This way you can get the single page application experience that you are probably searching for.

Please or to participate in this conversation.