Skip to content

Commit ec88a74

Browse files
committed
Fixed bug/simplified setup
Fixed bug where users littlelink pages (domain.com/@username) would display a 404 error. This was caused due to the .env config file not containing an App URL. This issue could be solved by simply adding a URL to the config, this is now not necessary anymore, making the setup process easier and less confusing.  I changed every instance of "{{ config('app.url') }}" to  "{{ url(' ') }}". This effectively automatically uses the correct URL for LittleLink links, even if LittleLink Custom is set up in a subdirectory. In my testing, I couldn't find any problems this might have caused, so this appears to do the job just as well as setting the URL in the config. If I find any issues with this, I will revert this change.
1 parent 3cf687a commit ec88a74

13 files changed

+25
-25
lines changed

resources/views/auth/confirm-password.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<x-guest-layout>
22
<x-auth-card>
33
<x-slot name="logo">
4-
<a href="{{ config('app.url') }}">
4+
<a href="{{ url('') }}">
55
<x-application-logo class="w-20 h-20 fill-current text-gray-500" />
66
</a>
77
</x-slot>

resources/views/auth/forgot-password.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<x-guest-layout>
22
<x-auth-card>
33
<x-slot name="logo">
4-
<a href="{{ config('app.url') }}">
4+
<a href="{{ url('') }}">
55
<x-application-logo class="w-20 h-20 fill-current text-gray-500" />
66
</a>
77
</x-slot>

resources/views/auth/login.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<x-guest-layout>
22
<x-auth-card>
33
<x-slot name="logo">
4-
<a href="{{ config('app.url') }}">
4+
<a href="{{ url('') }}">
55
<x-application-logo class="w-20 h-20 fill-current text-gray-500" />
66
</a>
77
</x-slot>

resources/views/auth/register.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<x-guest-layout>
1010
<x-auth-card>
1111
<x-slot name="logo">
12-
<a href="{{ config('app.url') }}">
12+
<a href="{{ url('') }}">
1313
<x-application-logo class="w-20 h-20 fill-current text-gray-500" />
1414
</a>
1515
</x-slot>

resources/views/auth/reset-password.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<x-guest-layout>
22
<x-auth-card>
33
<x-slot name="logo">
4-
<a href="{{ config('app.url') }}">
4+
<a href="{{ url('') }}">
55
<x-application-logo class="w-20 h-20 fill-current text-gray-500" />
66
</a>
77
</x-slot>

resources/views/auth/verify-email.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<x-guest-layout>
22
<x-auth-card>
33
<x-slot name="logo">
4-
<a href="{{ config('app.url') }}">
4+
<a href="{{ url('') }}">
55
<x-application-logo class="w-20 h-20 fill-current text-gray-500" />
66
</a>
77
</x-slot>

resources/views/home.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,11 @@ function update_color_scheme() {
103103
<div class="updated" style="display:none">
104104
@foreach($updatedPages as $page)
105105
@if(file_exists(base_path("img/$page->littlelink_name" . ".png" )))
106-
<a href="{{ config('app.url') }}/@<?= $page->littlelink_name ?>" target="_blank">
106+
<a href="{{ url('') }}/@<?= $page->littlelink_name ?>" target="_blank">
107107
<img src="{{ asset("img/$page->littlelink_name" . ".png") }}" srcset="{{ asset("img/$page->littlelink_name" . "@2x.png 2x") }}" width="50px" height="50px">
108108
</a>
109109
@else
110-
<a href="{{ config('app.url') }}/@<?= $page->littlelink_name ?>" target="_blank">
110+
<a href="{{ url('') }}/@<?= $page->littlelink_name ?>" target="_blank">
111111
<img src="{{ asset('littlelink/images/logo.svg') }}" srcset="{{ asset('littlelink/images/avatar@2x.png 2x') }}" width="50px" height="50px">
112112
</a>
113113
@endif
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div class="footer" style="margin:5% 0px 35px 0px;">
22
<!--<a href="/">Home</a>
3-
<a href="{{ config('app.url') }}/pages/terms">Terms</a>
4-
<a href="{{ config('app.url') }}/pages/privacy">Privacy</a>
5-
<a href="{{ config('app.url') }}/pages/contact">Contact</a>-->
3+
<a href="{{ url('') }}/pages/terms">Terms</a>
4+
<a href="{{ url('') }}/pages/privacy">Privacy</a>
5+
<a href="{{ url('') }}/pages/contact">Contact</a>-->
66
</div>

resources/views/layouts/sidebar.blade.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ function update_color_scheme() {
103103
<p>
104104
Copyright &copy; @php echo date('Y'); @endphp <i class="icon-heart" aria-hidden="true"></i> </br>
105105
<a href="/" target="_blank">Home</a> .
106-
<a href="{{ config('app.url') }}/pages/terms" target="_blank">Terms</a> .
107-
<a href="{{ config('app.url') }}/pages/privacy" target="_blank">Privacy</a> .
108-
<a href="{{ config('app.url') }}/pages/contact" target="_blank">Contact</a>
106+
<a href="{{ url('') }}/pages/terms" target="_blank">Terms</a> .
107+
<a href="{{ url('') }}/pages/privacy" target="_blank">Privacy</a> .
108+
<a href="{{ url('') }}/pages/contact" target="_blank">Contact</a>
109109
</p>
110110
</div>
111111
</div>
@@ -161,7 +161,7 @@ function URL_exists(string $url): bool
161161
@endif
162162
<! –– #### end update detection #### ––>
163163
164-
<a class="nav-link" href="{{ config('app.url') }}/@<?= Auth::user()->littlelink_name ?>" target="_blank">Watch Page</a>
164+
<a class="nav-link" href="{{ url('') }}/@<?= Auth::user()->littlelink_name ?>" target="_blank">Watch Page</a>
165165
</div>
166166
</li>
167167
</ul>

resources/views/littlelink.blade.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<!-- This shows a preview for title, description and avatar image of users profiles if shared on social media sites -->
1212

1313
<!-- Facebook Meta Tags -->
14-
<meta property="og:url" content="{{ config('app.url') }}/@littlelink_name">
14+
<meta property="og:url" content="{{ url('') }}/@littlelink_name">
1515
<meta property="og:type" content="website">
1616
<meta property="og:title" content="{{ $userinfo->littlelink_name }}">
1717
<meta property="og:description" content="{{ $userinfo->littlelink_description }}">
@@ -23,8 +23,8 @@
2323

2424
<!-- Twitter Meta Tags -->
2525
<meta name="twitter:card" content="summary_large_image">
26-
<meta property="twitter:domain" content="{{ config('app.url') }}/@littlelink_name">
27-
<meta property="twitter:url" content="{{ config('app.url') }}/@littlelink_name">
26+
<meta property="twitter:domain" content="{{ url('') }}/@littlelink_name">
27+
<meta property="twitter:url" content="{{ url('') }}/@littlelink_name">
2828
<meta name="twitter:title" content="{{ $userinfo->littlelink_name }}">
2929
<meta name="twitter:description" content="{{ $userinfo->littlelink_description }}">
3030
@if(file_exists(base_path("img/$littlelink_name" . ".png" )))

0 commit comments

Comments
 (0)