Skip to content

Commit bd108a9

Browse files
authored
Show view result when authenticated (alexjustesen#2502)
Co-authored-by: Alex Justesen <[email protected]>
1 parent bc0064a commit bd108a9

File tree

3 files changed

+30
-13
lines changed

3 files changed

+30
-13
lines changed

lang/en/auth.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
|
1414
*/
1515

16+
'sign_in' => 'Sign in',
1617
'failed' => 'These credentials do not match our records.',
1718
'password' => 'The provided password is incorrect.',
1819
'throttle' => 'Too many login attempts. Please try again in :seconds seconds.',

resources/views/layouts/app.blade.php

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,26 @@ class="p-2 rounded-md transition-all"
9191
</button>
9292
</div>
9393
94-
<x-filament::button
95-
href="{{ url('/admin') }}"
96-
tag="a"
97-
>
98-
Admin Panel
99-
</x-filament::button>
94+
@auth
95+
<x-filament::button
96+
href="{{ url('/admin') }}"
97+
icon="tabler-layout-dashboard"
98+
iconButton="true"
99+
tag="a"
100+
size="lg"
101+
>
102+
{{ __('general.admin') }}
103+
</x-filament::button>
104+
@else
105+
<x-filament::button
106+
href="{{ url('/login') }}"
107+
icon="tabler-login"
108+
tag="a"
109+
size="lg"
110+
>
111+
{{ __('auth.sign_in') }}
112+
</x-filament::button>
113+
@endauth
100114
</div>
101115
</header>
102116

resources/views/livewire/latest-result-stats.blade.php

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@
1212
<p class="mt-1 text-sm font-medium text-zinc-600 dark:text-zinc-400">{{ $this->latestResult->created_at->format(config('app.datetime_format')) }}</p>
1313
</div>
1414

15-
<x-filament::button
16-
href="{{ url('admin/results') }}"
17-
tag="a"
18-
size="sm"
19-
>
20-
{{ __('general.view') }}
21-
</x-filament::button>
15+
@auth
16+
<x-filament::button
17+
href="{{ url('admin/results') }}"
18+
tag="a"
19+
size="sm"
20+
>
21+
{{ __('general.view') }}
22+
</x-filament::button>
23+
@endauth
2224
</div>
2325
</div>
2426

0 commit comments

Comments
 (0)