From e5f8764d97a9f63d1aaac365049081b52f323ec6 Mon Sep 17 00:00:00 2001 From: Justin Date: Mon, 21 Oct 2024 14:21:17 -0400 Subject: [PATCH] livewire navigation links --- app/Livewire/CreatePosts.php | 5 ++++- resources/views/components/layouts/app.blade.php | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/Livewire/CreatePosts.php b/app/Livewire/CreatePosts.php index 505846a..4f6eb0d 100644 --- a/app/Livewire/CreatePosts.php +++ b/app/Livewire/CreatePosts.php @@ -40,6 +40,9 @@ public function save() 'post_content' => $this->content ]); - $this->redirect('/posts'); + $this->redirect('/posts', navigate: true); + /* + navigate: true here allows you to use livewire ajax navigation for redirects + */ } } diff --git a/resources/views/components/layouts/app.blade.php b/resources/views/components/layouts/app.blade.php index f99f54b..52232df 100644 --- a/resources/views/components/layouts/app.blade.php +++ b/resources/views/components/layouts/app.blade.php @@ -25,9 +25,9 @@ {{ $slot }}