File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
resources/views/livewire/pages/forum Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,12 @@ public function reloadThreads(?int $channelId): void
63
63
$ this ->dispatch ('render ' );
64
64
}
65
65
66
+ #[On('redirectToLogin ' )]
67
+ public function redirectToLogin (): void
68
+ {
69
+ $ this ->redirectRoute ('login ' , navigate: true );
70
+ }
71
+
66
72
protected function applySearch (Builder $ query ): Builder
67
73
{
68
74
if ($ this ->search ) {
Original file line number Diff line number Diff line change 2
2
<x-slot:buttons >
3
3
<x-buttons .primary
4
4
type =" button"
5
- onclick =" Livewire.dispatch('openPanel', { component: 'components.slideovers.thread-form' })"
5
+ onclick =" {{ Auth :: check () ? ' Livewire.dispatch(\ ' openPanel\ ' , { component: \ ' components.slideovers.thread-form\ ' })' : ' Livewire.dispatch( \' redirectToLogin \' ) ' } } "
6
6
class =" gap-2 w-full justify-center py-2.5"
7
7
>
8
8
{{ __ (' pages/forum.new_thread' ) } }
You can’t perform that action at this time.
0 commit comments