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.
This commit is contained in:
JulianPrieber 2022-02-27 19:33:19 +01:00
parent 3cf687a37f
commit ec88a74889
13 changed files with 25 additions and 25 deletions

View File

@ -1,7 +1,7 @@
<x-guest-layout> <x-guest-layout>
<x-auth-card> <x-auth-card>
<x-slot name="logo"> <x-slot name="logo">
<a href="{{ config('app.url') }}"> <a href="{{ url('') }}">
<x-application-logo class="w-20 h-20 fill-current text-gray-500" /> <x-application-logo class="w-20 h-20 fill-current text-gray-500" />
</a> </a>
</x-slot> </x-slot>

View File

@ -1,7 +1,7 @@
<x-guest-layout> <x-guest-layout>
<x-auth-card> <x-auth-card>
<x-slot name="logo"> <x-slot name="logo">
<a href="{{ config('app.url') }}"> <a href="{{ url('') }}">
<x-application-logo class="w-20 h-20 fill-current text-gray-500" /> <x-application-logo class="w-20 h-20 fill-current text-gray-500" />
</a> </a>
</x-slot> </x-slot>

View File

@ -1,7 +1,7 @@
<x-guest-layout> <x-guest-layout>
<x-auth-card> <x-auth-card>
<x-slot name="logo"> <x-slot name="logo">
<a href="{{ config('app.url') }}"> <a href="{{ url('') }}">
<x-application-logo class="w-20 h-20 fill-current text-gray-500" /> <x-application-logo class="w-20 h-20 fill-current text-gray-500" />
</a> </a>
</x-slot> </x-slot>

View File

@ -9,7 +9,7 @@ foreach($pages as $page)
<x-guest-layout> <x-guest-layout>
<x-auth-card> <x-auth-card>
<x-slot name="logo"> <x-slot name="logo">
<a href="{{ config('app.url') }}"> <a href="{{ url('') }}">
<x-application-logo class="w-20 h-20 fill-current text-gray-500" /> <x-application-logo class="w-20 h-20 fill-current text-gray-500" />
</a> </a>
</x-slot> </x-slot>

View File

@ -1,7 +1,7 @@
<x-guest-layout> <x-guest-layout>
<x-auth-card> <x-auth-card>
<x-slot name="logo"> <x-slot name="logo">
<a href="{{ config('app.url') }}"> <a href="{{ url('') }}">
<x-application-logo class="w-20 h-20 fill-current text-gray-500" /> <x-application-logo class="w-20 h-20 fill-current text-gray-500" />
</a> </a>
</x-slot> </x-slot>

View File

@ -1,7 +1,7 @@
<x-guest-layout> <x-guest-layout>
<x-auth-card> <x-auth-card>
<x-slot name="logo"> <x-slot name="logo">
<a href="{{ config('app.url') }}"> <a href="{{ url('') }}">
<x-application-logo class="w-20 h-20 fill-current text-gray-500" /> <x-application-logo class="w-20 h-20 fill-current text-gray-500" />
</a> </a>
</x-slot> </x-slot>

View File

@ -103,11 +103,11 @@ foreach($pages as $page)
<div class="updated" style="display:none"> <div class="updated" style="display:none">
@foreach($updatedPages as $page) @foreach($updatedPages as $page)
@if(file_exists(base_path("img/$page->littlelink_name" . ".png" ))) @if(file_exists(base_path("img/$page->littlelink_name" . ".png" )))
<a href="{{ config('app.url') }}/@<?= $page->littlelink_name ?>" target="_blank"> <a href="{{ url('') }}/@<?= $page->littlelink_name ?>" target="_blank">
<img src="{{ asset("img/$page->littlelink_name" . ".png") }}" srcset="{{ asset("img/$page->littlelink_name" . "@2x.png 2x") }}" width="50px" height="50px"> <img src="{{ asset("img/$page->littlelink_name" . ".png") }}" srcset="{{ asset("img/$page->littlelink_name" . "@2x.png 2x") }}" width="50px" height="50px">
</a> </a>
@else @else
<a href="{{ config('app.url') }}/@<?= $page->littlelink_name ?>" target="_blank"> <a href="{{ url('') }}/@<?= $page->littlelink_name ?>" target="_blank">
<img src="{{ asset('littlelink/images/logo.svg') }}" srcset="{{ asset('littlelink/images/avatar@2x.png 2x') }}" width="50px" height="50px"> <img src="{{ asset('littlelink/images/logo.svg') }}" srcset="{{ asset('littlelink/images/avatar@2x.png 2x') }}" width="50px" height="50px">
</a> </a>
@endif @endif

View File

@ -1,6 +1,6 @@
<div class="footer" style="margin:5% 0px 35px 0px;"> <div class="footer" style="margin:5% 0px 35px 0px;">
<!--<a href="/">Home</a> <!--<a href="/">Home</a>
<a href="{{ config('app.url') }}/pages/terms">Terms</a> <a href="{{ url('') }}/pages/terms">Terms</a>
<a href="{{ config('app.url') }}/pages/privacy">Privacy</a> <a href="{{ url('') }}/pages/privacy">Privacy</a>
<a href="{{ config('app.url') }}/pages/contact">Contact</a>--> <a href="{{ url('') }}/pages/contact">Contact</a>-->
</div> </div>

View File

@ -103,9 +103,9 @@
<p> <p>
Copyright &copy; @php echo date('Y'); @endphp <i class="icon-heart" aria-hidden="true"></i> </br> Copyright &copy; @php echo date('Y'); @endphp <i class="icon-heart" aria-hidden="true"></i> </br>
<a href="/" target="_blank">Home</a> . <a href="/" target="_blank">Home</a> .
<a href="{{ config('app.url') }}/pages/terms" target="_blank">Terms</a> . <a href="{{ url('') }}/pages/terms" target="_blank">Terms</a> .
<a href="{{ config('app.url') }}/pages/privacy" target="_blank">Privacy</a> . <a href="{{ url('') }}/pages/privacy" target="_blank">Privacy</a> .
<a href="{{ config('app.url') }}/pages/contact" target="_blank">Contact</a> <a href="{{ url('') }}/pages/contact" target="_blank">Contact</a>
</p> </p>
</div> </div>
</div> </div>
@ -161,7 +161,7 @@
@endif @endif
<! #### end update detection #### > <! #### end update detection #### >
<a class="nav-link" href="{{ config('app.url') }}/@<?= Auth::user()->littlelink_name ?>" target="_blank">Watch Page</a> <a class="nav-link" href="{{ url('') }}/@<?= Auth::user()->littlelink_name ?>" target="_blank">Watch Page</a>
</div> </div>
</li> </li>
</ul> </ul>

View File

@ -11,7 +11,7 @@
<!-- This shows a preview for title, description and avatar image of users profiles if shared on social media sites --> <!-- This shows a preview for title, description and avatar image of users profiles if shared on social media sites -->
<!-- Facebook Meta Tags --> <!-- Facebook Meta Tags -->
<meta property="og:url" content="{{ config('app.url') }}/@littlelink_name"> <meta property="og:url" content="{{ url('') }}/@littlelink_name">
<meta property="og:type" content="website"> <meta property="og:type" content="website">
<meta property="og:title" content="{{ $userinfo->littlelink_name }}"> <meta property="og:title" content="{{ $userinfo->littlelink_name }}">
<meta property="og:description" content="{{ $userinfo->littlelink_description }}"> <meta property="og:description" content="{{ $userinfo->littlelink_description }}">
@ -23,8 +23,8 @@
<!-- Twitter Meta Tags --> <!-- Twitter Meta Tags -->
<meta name="twitter:card" content="summary_large_image"> <meta name="twitter:card" content="summary_large_image">
<meta property="twitter:domain" content="{{ config('app.url') }}/@littlelink_name"> <meta property="twitter:domain" content="{{ url('') }}/@littlelink_name">
<meta property="twitter:url" content="{{ config('app.url') }}/@littlelink_name"> <meta property="twitter:url" content="{{ url('') }}/@littlelink_name">
<meta name="twitter:title" content="{{ $userinfo->littlelink_name }}"> <meta name="twitter:title" content="{{ $userinfo->littlelink_name }}">
<meta name="twitter:description" content="{{ $userinfo->littlelink_description }}"> <meta name="twitter:description" content="{{ $userinfo->littlelink_description }}">
@if(file_exists(base_path("img/$littlelink_name" . ".png" ))) @if(file_exists(base_path("img/$littlelink_name" . ".png" )))

View File

@ -43,7 +43,7 @@
<label>Page URL</label> <label>Page URL</label>
<div class="input-group"> <div class="input-group">
<div class="input-group-prepend"> <div class="input-group-prepend">
<div class="input-group-text">{{ config('app.url') }}/@</div> <div class="input-group-text">{{ url('') }}/@</div>
</div> </div>
<input type="text" class="form-control" name="littlelink_name" value="{{ $user->littlelink_name }}"> <input type="text" class="form-control" name="littlelink_name" value="{{ $user->littlelink_name }}">
</div> </div>

View File

@ -12,10 +12,10 @@
</div> </div>
</form> </form>
Users: Users:
<a href="{{ config('app.url') }}/panel/users/all">All</a> - <a href="{{ url('') }}/panel/users/all">All</a> -
<a href="{{ config('app.url') }}/panel/users/user">User</a> - <a href="{{ url('') }}/panel/users/user">User</a> -
<a href="{{ config('app.url') }}/panel/users/vip">Vip</a> - <a href="{{ url('') }}/panel/users/vip">Vip</a> -
<a href="{{ config('app.url') }}/panel/users/admin">Admin</a> <a href="{{ url('') }}/panel/users/admin">Admin</a>
<table class="table table-bordered"> <table class="table table-bordered">
<thead> <thead>
@ -31,7 +31,7 @@
@foreach($users as $user) @foreach($users as $user)
<tr> <tr>
<td> {{ $user->name }} </td> <td> {{ $user->name }} </td>
<td><a href="{{ config('app.url') }}/@<?= $user->littlelink_name ?>" target="_blank" class="text-info"><i class="bi bi-box-arrow-up-right"></i>&nbsp; {{ $user->littlelink_name }} </a></td> <td><a href="{{ url('') }}/@<?= $user->littlelink_name ?>" target="_blank" class="text-info"><i class="bi bi-box-arrow-up-right"></i>&nbsp; {{ $user->littlelink_name }} </a></td>
<td>{{ $user->role }}</td> <td>{{ $user->role }}</td>
<td><a href="{{ route('editUser', $user->id ) }}">Edit</a></td> <td><a href="{{ route('editUser', $user->id ) }}">Edit</a></td>
<td><a href="{{ route('blockUser', ['block' => $user->block, 'id' => $user->id] ) }}" class="text-danger">{{ $user->block }}</a></td> <td><a href="{{ route('blockUser', ['block' => $user->block, 'id' => $user->id] ) }}" class="text-danger">{{ $user->block }}</a></td>

View File

@ -29,7 +29,7 @@
<label>Page URL</label> <label>Page URL</label>
<div class="input-group"> <div class="input-group">
<div class="input-group-prepend"> <div class="input-group-prepend">
<div class="input-group-text">{{ config('app.url') }}/@</div> <div class="input-group-text">{{ url('') }}/@</div>
</div> </div>
<input type="text" class="form-control" name="pageName" value="{{ $page->littlelink_name ?? '' }}"> <input type="text" class="form-control" name="pageName" value="{{ $page->littlelink_name ?? '' }}">
</div> </div>