refactor: 💄 Changed model.getValueByKey -> using laravel config system (At App-Service-Provider)

This commit is contained in:
IceToast 2022-01-14 13:34:37 +01:00
parent 8d03cf8322
commit 4c2696ca6b
9 changed files with 233 additions and 232 deletions

View file

@ -53,9 +53,16 @@ class AppServiceProvider extends ServiceProvider
// Set Discord-API Config
config(['services.discord.client_id' => Settings::getValueByKey('SETTINGS::DISCORD:CLIENT_ID')]);
config(['services.discord.client_secret' => Settings::getValueByKey('SETTINGS::DISCORD:CLIENT_SECRET')]);
config(['services.discord.SETTINGS::SYSTEM:SERVER_CREATE_CHARGE_FIRST_HOUR' => 'test']);
//// Set Recaptcha API Config
// Set Recaptcha API Config
config(['recaptcha.api_site_key' => Settings::getValueByKey('SETTINGS::RECAPTCHA:SITE_KEY')]);
config(['recaptcha.api_secret_key' => Settings::getValueByKey('SETTINGS::RECAPTCHA:SECRET_KEY')]);
// Set all configs from database
$settings = Settings::all();
foreach ($settings as $setting) {
config([$setting->key => $setting->value]);
}
}
}

View file

@ -13,7 +13,7 @@
<div class="custom-control mb-3">
<label for="company-name">{{ __('Enter your companys name') }}</label>
<input x-model="company-name" id="company-name" name="company-name" type="text" required
value="{{ App\Models\Settings::getValueByKey("SETTINGS::INVOICE:COMPANY_NAME") }}"
value="{{ config('SETTINGS::INVOICE:COMPANY_NAME') }}"
class="form-control @error('company-name') is-invalid @enderror">
</div>
</div>
@ -22,7 +22,7 @@
<div class="custom-control mb-3">
<label for="company-address">{{ __('Enter your companys address') }}</label>
<input x-model="company-address" id="company-address" name="company-address" type="text"
value="{{ App\Models\Settings::getValueByKey("SETTINGS::INVOICE:COMPANY_ADDRESS") }}"
value="{{ config('SETTINGS::INVOICE:COMPANY_ADDRESS') }}"
class="form-control @error('company-address') is-invalid @enderror">
</div>
</div>
@ -31,7 +31,7 @@
<div class="custom-control mb-3">
<label for="company-phone">{{ __('Enter your companys phone number') }}</label>
<input x-model="company-phone" id="company-phone" name="company-phone" type="text"
value="{{ App\Models\Settings::getValueByKey("SETTINGS::INVOICE:COMPANY_PHONE") }}"
value="{{ config('SETTINGS::INVOICE:COMPANY_PHONE') }}"
class="form-control @error('company-phone') is-invalid @enderror">
</div>
</div>
@ -41,7 +41,7 @@
<div class="custom-control mb-3">
<label for="company-vat">{{ __('Enter your companys VAT id') }}</label>
<input x-model="company-vat" id="company-vat" name="company-vat" type="text"
value="{{ App\Models\Settings::getValueByKey("SETTINGS::INVOICE:COMPANY_VAT") }}"
value="{{ config('SETTINGS::INVOICE:COMPANY_VAT') }}"
class="form-control @error('company-vat') is-invalid @enderror">
</div>
</div>
@ -52,7 +52,7 @@
<div class="custom-control mb-3">
<label for="company-mail">{{ __('Enter your companys email address') }}</label>
<input x-model="company-mail" id="company-mail" name="company-mail" type="text"
value="{{ App\Models\Settings::getValueByKey("SETTINGS::INVOICE:COMPANY_MAIL") }}"
value="{{ config('SETTINGS::INVOICE:COMPANY_MAIL') }}"
class="form-control @error('company-mail') is-invalid @enderror">
</div>
</div>
@ -61,7 +61,7 @@
<div class="custom-control mb-3">
<label for="company-web">{{ __('Enter your companys website') }}</label>
<input x-model="company-web" id="company-web" name="company-web" type="text"
value="{{ App\Models\Settings::getValueByKey("SETTINGS::INVOICE:COMPANY_WEBSITE") }}"
value="{{ config('SETTINGS::INVOICE:COMPANY_WEBSITE') }}"
class="form-control @error('company-web') is-invalid @enderror">
</div>
</div>
@ -71,7 +71,7 @@
<div class="custom-control mb-3">
<label for="invoice-prefix">{{ __('Enter your custom invoice prefix') }}</label>
<input x-model="invoice-prefix" id="invoice-prefix" name="invoice-prefix" type="text" required
value="{{ App\Models\Settings::getValueByKey("SETTINGS::INVOICE:PREFIX") }}"
value="{{ config('SETTINGS::INVOICE:PREFIX') }}"
class="form-control @error('invoice-prefix') is-invalid @enderror">
</div>
</div>
@ -101,4 +101,3 @@
</form>
</div>

View file

@ -1,6 +1,6 @@
<div class="tab-pane mt-3" id="language">
<form method="POST" enctype="multipart/form-data" class="mb-3"
action="{{ route('admin.settings.update.languagesettings') }}">
action="{{ route('admin.settings.update.languagesettings') }}">
@csrf
@method('PATCH')
@ -8,70 +8,59 @@
<div class="col-md-6">
<div class="form-group">
<!-- AVAILABLE LANGUAGES -->
<label for="languages">{{__("Available languages")}}:</label>
<label for="languages">{{ __('Available languages') }}:</label>
<select id="languages" style="width:100%"
class="custom-select" name="languages[]"
required
multiple="multiple" autocomplete="off">
@foreach(config("app.available_locales") as $lang)
<option value="{{$lang}}">{{__($lang)}}</option>
<select id="languages" style="width:100%" class="custom-select" name="languages[]" required
multiple="multiple" autocomplete="off">
@foreach (config('app.available_locales') as $lang)
<option value="{{ $lang }}">{{ __($lang) }}</option>
@endforeach
</select>
<!-- DEFAULT LANGUAGE -->
<label for="defaultLanguage">{{__("Default language")}}: <i data-toggle="popover"
data-trigger="hover"
data-content="{{__('The fallback Language, if something goes wrong')}}"
class="fas fa-info-circle"></i></label>
<label for="defaultLanguage">{{ __('Default language') }}: <i data-toggle="popover"
data-trigger="hover"
data-content="{{ __('The fallback Language, if something goes wrong') }}"
class="fas fa-info-circle"></i></label>
<select id="defaultLanguage" style="width:100%"
class="custom-select" name="defaultLanguage"
required
autocomplete="off">
<option
value="{{\App\Models\Settings::getValueByKey("SETTINGS::LOCALE:DEFAULT")}}"
selected>
{{__(\App\Models\Settings::getValueByKey("SETTINGS::LOCALE:DEFAULT"))}}</option>
@foreach(config("app.available_locales") as $lang)
<option value="{{$lang}}">{{__($lang)}}</option>
<select id="defaultLanguage" style="width:100%" class="custom-select" name="defaultLanguage"
required autocomplete="off">
<option value="{{ config('SETTINGS::LOCALE:DEFAULT') }}" selected>
{{ __(config('SETTINGS::LOCALE:DEFAULT')) }}</option>
@foreach (config('app.available_locales') as $lang)
<option value="{{ $lang }}">{{ __($lang) }}</option>
@endforeach
</select>
</div>
<!--DATATABLE LANGUAGE -->
<label for="datatable-language">{{__('Datable language')}} <i data-toggle="popover"
data-trigger="hover"
data-content="{{__('The Language of the Datatables. Grab the Language-Codes from here')}} https://datatables.net/plug-ins/i18n/"
class="fas fa-info-circle"></i></label>
<label for="datatable-language">{{ __('Datable language') }} <i data-toggle="popover"
data-trigger="hover"
data-content="{{ __('The Language of the Datatables. Grab the Language-Codes from here') }} https://datatables.net/plug-ins/i18n/"
class="fas fa-info-circle"></i></label>
<input x-model="datatable-language" id="datatable-language" name="datatable-language" type="text"
required
value="{{ App\Models\Settings::getValueByKey("SETTINGS::LOCALE:DATATABLES") }}"
class="form-control @error('datatable-language') is-invalid @enderror">
required value="{{ config('SETTINGS::LOCALE:DATATABLES') }}"
class="form-control @error('datatable-language') is-invalid @enderror">
</div>
</div>
<!-- AUTO TRANSLATE -->
<div class="form-group">
<input value="true" id="autotranslate" name="autotranslate"
{{(\App\Models\Settings::getValueByKey("SETTINGS::LOCALE:DYNAMIC")=="true"?"checked":"")}}
type="checkbox">
<label for="autotranslate">{{__('Auto-translate')}} <i data-toggle="popover"
data-trigger="hover"
data-content="{{__('If this is checked, the Dashboard will translate itself to the Clients language, if available')}}"
class="fas fa-info-circle"></i></label>
{{ config('SETTINGS::LOCALE:DYNAMIC') == 'true' ? 'checked' : '' }} type="checkbox">
<label for="autotranslate">{{ __('Auto-translate') }} <i data-toggle="popover" data-trigger="hover"
data-content="{{ __('If this is checked, the Dashboard will translate itself to the Clients language, if available') }}"
class="fas fa-info-circle"></i></label>
<br/>
<br />
<!-- CLIENTS CAN CHANGE -->
<input value="true" id="canClientChangeLanguage" name="canClientChangeLanguage"
{{(\App\Models\Settings::getValueByKey("SETTINGS::LOCALE:CLIENTS_CAN_CHANGE")=="true"?"checked":"")}}
type="checkbox">
<label for="canClientChangeLanguage">{{__('Let the Client change the Language')}} <i
data-toggle="popover"
data-trigger="hover"
data-content="{{__('If this is checked, Clients will have the ability to manually change their Dashboard language')}}"
{{ config('SETTINGS::LOCALE:CLIENTS_CAN_CHANGE') == 'true' ? 'checked' : '' }} type="checkbox">
<label for="canClientChangeLanguage">{{ __('Let the Client change the Language') }} <i
data-toggle="popover" data-trigger="hover"
data-content="{{ __('If this is checked, Clients will have the ability to manually change their Dashboard language') }}"
class="fas fa-info-circle"></i></label>
</div>

View file

@ -1,6 +1,6 @@
<div class="tab-pane mt-3" id="misc">
<form method="POST" enctype="multipart/form-data" class="mb-3"
action="{{ route('admin.settings.update.miscsettings') }}">
action="{{ route('admin.settings.update.miscsettings') }}">
@csrf
@method('PATCH')
@ -16,19 +16,19 @@
<label
for="phpmyadmin-url">{{ __('The URL to your PHPMYADMIN Panel. Must not end with a /, leave blank to remove database button') }}</label>
<input x-model="phpmyadmin-url" id="phpmyadmin-url" name="phpmyadmin-url" type="text"
value="{{ App\Models\Settings::getValueByKey("SETTINGS::MISC:PHPMYADMIN:URL") }}"
class="form-control @error('phpmyadmin-url') is-invalid @enderror">
value="{{ config('SETTINGS::MISC:PHPMYADMIN:URL') }}"
class="form-control @error('phpmyadmin-url') is-invalid @enderror">
</div>
</div>
<div class="form-group">
<div class="custom-file mb-3 mt-3">
<input type="file" accept="image/png,image/jpeg,image/jpg" class="custom-file-input" name="icon"
id="icon">
id="icon">
<label class="custom-file-label selected" for="icon">{{ __('Select panel icon') }}</label>
</div>
@error('icon')
<span class="text-danger">
<span class="text-danger">
{{ $message }}
</span>
@enderror
@ -37,76 +37,72 @@
<div class="custom-file mb-3">
<input type="file" accept="image/x-icon" class="custom-file-input" name="favicon" id="favicon">
<label class="custom-file-label selected"
for="favicon">{{ __('Select panel favicon') }}</label>
for="favicon">{{ __('Select panel favicon') }}</label>
</div>
@error('favicon')
<span class="text-danger">
<span class="text-danger">
{{ $message }}
</span>
@enderror
</div>
</div>
<div class="col-md-3">
<img class="mb-3" height="50"
src="{{ url('/images/discord_logo.png') }}">
<img class="mb-3" height="50" src="{{ url('/images/discord_logo.png') }}">
<!-- DISCORD -->
<div class="form-group">
<div class="custom-control mb-3">
<label for="discord-client-id">{{ __('Your Discord client-id')}} ( Discord API Credentials -
<label for="discord-client-id">{{ __('Your Discord client-id') }} ( Discord API Credentials -
https://discordapp.com/developers/applications/ ) </label>
<input x-model="discord-client-id" id="discord-client-id" name="discord-client-id" type="text"
value="{{ App\Models\Settings::getValueByKey("SETTINGS::DISCORD:CLIENT_ID") }}"
class="form-control @error('discord-client-id') is-invalid @enderror">
value="{{ config('SETTINGS::DISCORD:CLIENT_ID') }}"
class="form-control @error('discord-client-id') is-invalid @enderror">
</div>
</div>
<div class="form-group">
<div class="custom-control mb-3">
<label for="discord-client-secret">{{ __('Your Discord client-secret')}} </label>
<label for="discord-client-secret">{{ __('Your Discord client-secret') }} </label>
<input x-model="discord-client-secret" id="discord-client-secret" name="discord-client-secret"
type="text"
value="{{ App\Models\Settings::getValueByKey("SETTINGS::DISCORD:CLIENT_SECRET") }}"
class="form-control @error('discord-client-secret') is-invalid @enderror">
type="text" value="{{ config('SETTINGS::DISCORD:CLIENT_SECRET') }}"
class="form-control @error('discord-client-secret') is-invalid @enderror">
</div>
</div>
<div class="form-group">
<div class="custom-control mb-3">
<label for="discord-client-secret">{{ __('Your Discord Bot-token')}} </label>
<input x-model="discord-bot-token" id="discord-bot-token" name="discord-bot-token"
type="text"
value="{{ App\Models\Settings::getValueByKey("SETTINGS::DISCORD:BOT_TOKEN") }}"
class="form-control @error('discord-bot-token') is-invalid @enderror">
<label for="discord-client-secret">{{ __('Your Discord Bot-token') }} </label>
<input x-model="discord-bot-token" id="discord-bot-token" name="discord-bot-token" type="text"
value="{{ config('SETTINGS::DISCORD:BOT_TOKEN') }}"
class="form-control @error('discord-bot-token') is-invalid @enderror">
</div>
</div>
<div class="form-group">
<div class="custom-control mb-3">
<label for="discord-client-secret">{{ __('Your Discord Guild-ID')}} </label>
<input x-model="discord-guild-id" id="discord-guild-id" name="discord-guild-id"
type="number"
value="{{ App\Models\Settings::getValueByKey("SETTINGS::DISCORD:GUILD_ID") }}"
class="form-control @error('discord-guild-id') is-invalid @enderror">
<label for="discord-client-secret">{{ __('Your Discord Guild-ID') }} </label>
<input x-model="discord-guild-id" id="discord-guild-id" name="discord-guild-id" type="number"
value="{{ config('SETTINGS::DISCORD:GUILD_ID') }}"
class="form-control @error('discord-guild-id') is-invalid @enderror">
</div>
</div>
<div class="form-group">
<div class="custom-control mb-3">
<label for="discord-invite-url">{{ __('Your Discord Server iniviation url')}} </label>
<label for="discord-invite-url">{{ __('Your Discord Server iniviation url') }} </label>
<input x-model="discord-invite-url" id="discord-invite-url" name="discord-invite-url"
type="text"
value="{{ App\Models\Settings::getValueByKey("SETTINGS::DISCORD:INVITE_URL") }}"
class="form-control @error('discord-invite-url') is-invalid @enderror">
type="text" value="{{ config('SETTINGS::DISCORD:INVITE_URL') }}"
class="form-control @error('discord-invite-url') is-invalid @enderror">
</div>
</div>
<div class="form-group">
<div class="custom-control mb-3">
<label for="discord-role-id">{{ __('Discord role that will be assigned to users when they register (optional)')}} </label>
<input x-model="discord-role-id" id="discord-role-id" name="discord-role-id"
type="number"
value="{{ App\Models\Settings::getValueByKey("SETTINGS::DISCORD:ROLE_ID") }}"
class="form-control @error('discord-role-id') is-invalid @enderror">
<label
for="discord-role-id">{{ __('Discord role that will be assigned to users when they register (optional)') }}
</label>
<input x-model="discord-role-id" id="discord-role-id" name="discord-role-id" type="number"
value="{{ config('SETTINGS::DISCORD:ROLE_ID') }}"
class="form-control @error('discord-role-id') is-invalid @enderror">
</div>
</div>

View file

@ -1,32 +1,30 @@
<div class="tab-pane mt-3" id="payments">
<form method="POST" enctype="multipart/form-data" class="mb-3"
action="{{ route('admin.settings.update.paymentsettings') }}">
action="{{ route('admin.settings.update.paymentsettings') }}">
@csrf
@method('PATCH')
<div class="row">
<div class="col-md-6">
<img class="mb-3" height="50"
src="{{ url('/images/paypal_logo.png') }}">
<img class="mb-3" height="50" src="{{ url('/images/paypal_logo.png') }}">
<!-- PAYPAL -->
<div class="form-group">
<div class="custom-control mb-3">
<label for="paypal-client-id">{{ __('Enter your PayPal Client_ID') }}</label>
<input x-model="paypal-client-id" id="paypal-client-id" name="paypal-client-id" type="text"
value="{{ App\Models\Settings::getValueByKey("SETTINGS::PAYMENTS:PAYPAL:CLIENT_ID") }}"
class="form-control @error('paypal-client-id') is-invalid @enderror">
value="{{ config('SETTINGS::PAYMENTS:PAYPAL:CLIENT_ID') }}"
class="form-control @error('paypal-client-id') is-invalid @enderror">
</div>
</div>
<!-- PAYPAL -->
<div class="form-group">
<div class="custom-control mb-3">
<label for="paypal-client-secret">{{ __('Your PayPal Secret-Key')}} (
<label for="paypal-client-secret">{{ __('Your PayPal Secret-Key') }} (
https://developer.paypal.com/docs/integration/direct/rest/ ) </label>
<input x-model="paypal-client-secret" id="paypal-client-secret" name="paypal-client-secret"
type="text"
value="{{ App\Models\Settings::getValueByKey("SETTINGS::PAYMENTS:PAYPAL:SECRET") }}"
class="form-control @error('paypal-client-secret') is-invalid @enderror">
type="text" value="{{ config('SETTINGS::PAYMENTS:PAYPAL:SECRET') }}"
class="form-control @error('paypal-client-secret') is-invalid @enderror">
</div>
</div>
@ -36,8 +34,8 @@
<label
for="paypal-sandbox-id">{{ __('Your PayPal SANDBOX Client-ID used for testing') }}</label>
<input x-model="paypal-sandbox-id" id="paypal-sandbox-id" name="paypal-sandbox-id" type="text"
value="{{ App\Models\Settings::getValueByKey("SETTINGS::PAYMENTS:PAYPAL:SANDBOX_CLIENT_ID") }}"
class="form-control @error('paypal-sandbox-id') is-invalid @enderror">
value="{{ config('SETTINGS::PAYMENTS:PAYPAL:SANDBOX_CLIENT_ID') }}"
class="form-control @error('paypal-sandbox-id') is-invalid @enderror">
</div>
</div>
@ -47,24 +45,22 @@
<label
for="paypal-sandbox-secret">{{ __('Your PayPal SANDBOX Secret-Key used for testing ') }}</label>
<input x-model="paypal-sandbox-secret" id="paypal-sandbox-secret" name="paypal-sandbox-secret"
type="text"
value="{{ App\Models\Settings::getValueByKey("SETTINGS::PAYMENTS:PAYPAL:SANDBOX_SECRET") }}"
class="form-control @error('paypal-sandbox-secret') is-invalid @enderror">
type="text" value="{{ config('SETTINGS::PAYMENTS:PAYPAL:SANDBOX_SECRET') }}"
class="form-control @error('paypal-sandbox-secret') is-invalid @enderror">
</div>
</div>
</div>
<div class="col-md-6">
<img class="mb-3" height="50"
src="{{ url('/images/stripe_logo.png') }}">
<img class="mb-3" height="50" src="{{ url('/images/stripe_logo.png') }}">
<!-- STRIPE -->
<div class="form-group">
<div class="custom-control mb-3">
<label for="stripe-secret">{{ __('Your Stripe Secret-Key')}} (
<label for="stripe-secret">{{ __('Your Stripe Secret-Key') }} (
https://dashboard.stripe.com/account/apikeys )</label>
<input x-model="stripe-secret" id="stripe-secret" name="stripe-secret" type="text"
value="{{ App\Models\Settings::getValueByKey("SETTINGS::PAYMENTS:STRIPE:SECRET") }}"
class="form-control @error('stripe-secret') is-invalid @enderror">
value="{{ config('SETTINGS::PAYMENTS:STRIPE:SECRET') }}"
class="form-control @error('stripe-secret') is-invalid @enderror">
</div>
</div>
<!-- STRIPE -->
@ -72,9 +68,9 @@
<div class="custom-control mb-3">
<label for="stripe-endpoint-secret">{{ __('Enter your Stripe endpoint-secret-key') }}</label>
<input x-model="stripe-endpoint-secret" id="stripe-endpoint-secret"
name="stripe-endpoint-secret" type="text"
value="{{ App\Models\Settings::getValueByKey("SETTINGS::PAYMENTS:STRIPE:ENDPOINT_SECRET") }}"
class="form-control @error('stripe-endpoint-secret') is-invalid @enderror">
name="stripe-endpoint-secret" type="text"
value="{{ config('SETTINGS::PAYMENTS:STRIPE:ENDPOINT_SECRET') }}"
class="form-control @error('stripe-endpoint-secret') is-invalid @enderror">
</div>
</div>
@ -83,9 +79,8 @@
<div class="custom-control mb-3">
<label for="stripe-test-secret">{{ __('Enter your Stripe test-secret-key') }}</label>
<input x-model="stripe-test-secret" id="stripe-test-secret" name="stripe-test-secret"
type="text"
value="{{ App\Models\Settings::getValueByKey("SETTINGS::PAYMENTS:STRIPE:TEST_SECRET") }}"
class="form-control @error('stripe-test-secret') is-invalid @enderror">
type="text" value="{{ config('SETTINGS::PAYMENTS:STRIPE:TEST_SECRET') }}"
class="form-control @error('stripe-test-secret') is-invalid @enderror">
</div>
</div>
@ -95,20 +90,21 @@
<label
for="stripe-endpoint-test-secret">{{ __('Enter your Stripe endpoint-test-secret-key') }}</label>
<input x-model="stripe-endpoint-test-secret" id="stripe-endpoint-test-secret"
name="stripe-endpoint-test-secret" type="text"
value="{{ App\Models\Settings::getValueByKey("SETTINGS::PAYMENTS:STRIPE:ENDPOINT_TEST_SECRET") }}"
class="form-control @error('stripe-endpoint-test-secret') is-invalid @enderror">
name="stripe-endpoint-test-secret" type="text"
value="{{ config('SETTINGS::PAYMENTS:STRIPE:ENDPOINT_TEST_SECRET') }}"
class="form-control @error('stripe-endpoint-test-secret') is-invalid @enderror">
</div>
</div>
<!-- STRIPE -->
<div class="form-group">
<div class="custom-control mb-3">
<label for="stripe-methods">{{ __('Comma seperated list of payment methods that are enabled')}}
<label
for="stripe-methods">{{ __('Comma seperated list of payment methods that are enabled') }}
(https://stripe.com/docs/payments/payment-methods/integration-options)</label>
<input x-model="stripe-methods" id="stripe-methods" name="stripe-methods" type="text"
value="{{ App\Models\Settings::getValueByKey("SETTINGS::PAYMENTS:STRIPE:METHODS") }}"
class="form-control @error('stripe-methods') is-invalid @enderror">
value="{{ config('SETTINGS::PAYMENTS:STRIPE:METHODS') }}"
class="form-control @error('stripe-methods') is-invalid @enderror">
</div>
</div>
</div>
@ -122,10 +118,10 @@
<div class="form-group">
<div class="custom-control mb-3">
<label
for="sales_tax">{{ __('The %-value of tax that will be added to the product price on checkout')}}</label>
for="sales_tax">{{ __('The %-value of tax that will be added to the product price on checkout') }}</label>
<input x-model="sales_tax" id="sales_tax" name="sales_tax" type="number"
value="{{ App\Models\Settings::getValueByKey("SETTINGS::PAYMENTS:SALES_TAX") }}"
class="form-control @error('sales_tax') is-invalid @enderror">
value="{{ config('SETTINGS::PAYMENTS:SALES_TAX') }}"
class="form-control @error('sales_tax') is-invalid @enderror">
</div>
</div>
</div>
@ -137,4 +133,3 @@
</form>
</div>

View file

@ -49,34 +49,34 @@
class="fas fa-home mr-2"></i>{{ __('Home') }}</a>
</li>
<li class="nav-item d-none d-sm-inline-block">
<a href="{{ \App\Models\Settings::getValueByKey("SETTINGS::DISCORD:INVITE_URL") }}" class="nav-link" target="__blank"><i
class="fab fa-discord mr-2"></i>{{ __('Discord') }}</a>
<a href="{{ config('SETTINGS::DISCORD:INVITE_URL') }}" class="nav-link"
target="__blank"><i class="fab fa-discord mr-2"></i>{{ __('Discord') }}</a>
</li>
<!-- Language Selection -->
@if (\App\Models\Settings::getValueByKey("SETTINGS::LOCALE:CLIENTS_CAN_CHANGE")=='true')
<li class="nav-item dropdown">
<a class="nav-link" href="#" id="languageDropdown" role="button" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
<span class="mr-1 d-lg-inline text-gray-600">
<small><i class="fa fa-language mr-2"></i></small>{{ __('Language') }}
</span>
</a>
<div class="dropdown-menu dropdown-menu-right shadow animated--grow-in"
aria-labelledby="changeLocale">
<form method="post" action="{{ route('changeLocale') }}" class="nav-item text-center">
@csrf
@foreach (json_decode(\App\Models\Settings::getValueByKey("SETTINGS::LOCALE:AVAILABLE")) as $key)
@if (config('SETTINGS::LOCALE:CLIENTS_CAN_CHANGE') == 'true')
<li class="nav-item dropdown">
<a class="nav-link" href="#" id="languageDropdown" role="button" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
<span class="mr-1 d-lg-inline text-gray-600">
<small><i class="fa fa-language mr-2"></i></small>{{ __('Language') }}
</span>
</a>
<div class="dropdown-menu dropdown-menu-right shadow animated--grow-in"
aria-labelledby="changeLocale">
<form method="post" action="{{ route('changeLocale') }}" class="nav-item text-center">
@csrf
@foreach (json_decode(config('SETTINGS::LOCALE:AVAILABLE')) as $key)
<button class="dropdown-item" name="inputLocale" value="{{ $key }}">
{{ __($key) }}
</button>
@endforeach
@endforeach
</form>
</div>
</li>
<!-- End Language Selection -->
@endif
</form>
</div>
</li>
<!-- End Language Selection -->
@endif
</ul>
<!-- Right navbar links -->
@ -211,7 +211,7 @@
</a>
</li>
@if ((\App\Models\Settings::getValueByKey("SETTINGS::PAYMENTS:PAYPAL:SECRET") && \App\Models\Settings::getValueByKey("SETTINGS::PAYMENTS:PAYPAL:CLIENT_ID")) || env('APP_ENV', 'local') == 'local')
@if ((config('SETTINGS::PAYMENTS:PAYPAL:SECRET') && config('SETTINGS::PAYMENTS:PAYPAL:CLIENT_ID')) || env('APP_ENV', 'local') == 'local')
<li class="nav-item">
<a href="{{ route('store.index') }}" class="nav-link @if (Request::routeIs('store.*') || Request::routeIs('checkout')) active @endif">
<i class="nav-icon fa fa-coins"></i>
@ -258,7 +258,8 @@
</li>
<li class="nav-item">
<a href="{{ route('admin.servers.index') }}" class="nav-link @if (Request::routeIs('admin.servers.*')) active @endif">
<a href="{{ route('admin.servers.index') }}"
class="nav-link @if (Request::routeIs('admin.servers.*')) active @endif">
<i class="nav-icon fas fa-server"></i>
<p>{{ __('Servers') }}</p>
</a>

View file

@ -6,12 +6,13 @@
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1>{{__('Profile')}}</h1>
<h1>{{ __('Profile') }}</h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="{{route('home')}}">{{__('Dashboard')}}</a></li>
<li class="breadcrumb-item"><a class="text-muted" href="{{route('profile.index')}}">{{__('Profile')}}</a>
<li class="breadcrumb-item"><a href="{{ route('home') }}">{{ __('Dashboard') }}</a></li>
<li class="breadcrumb-item"><a class="text-muted"
href="{{ route('profile.index') }}">{{ __('Profile') }}</a>
</li>
</ol>
</div>
@ -26,28 +27,36 @@
<div class="row">
<div class="col-lg-12 px-0">
@if(!Auth::user()->hasVerifiedEmail() && strtolower($force_email_verification) == 'true')
@if (!Auth::user()->hasVerifiedEmail() && strtolower($force_email_verification) == 'true')
<div class="alert alert-warning p-2 m-2">
<h5><i class="icon fas fa-exclamation-circle"></i>{{__('Required Email verification!')}}</h5>
{{__('You have not yet verified your email address')}}
<a class="text-primary" href="{{route('verification.send')}}">{{__('Click here to resend verification email')}}</a> <br>
{{__('Please contact support If you didnt receive your verification email.')}}
<h5><i class="icon fas fa-exclamation-circle"></i>{{ __('Required Email verification!') }}
</h5>
{{ __('You have not yet verified your email address') }}
<a class="text-primary"
href="{{ route('verification.send') }}">{{ __('Click here to resend verification email') }}</a>
<br>
{{ __('Please contact support If you didnt receive your verification email.') }}
</div>
@endif
@if(is_null(Auth::user()->discordUser) && strtolower($force_discord_verification) == 'true')
@if(!empty(\App\Models\Settings::getValueByKey("SETTINGS::DISCORD:CLIENT_ID")) && !empty(\App\Models\Settings::getValueByKey("SETTINGS::DISCORD:CLIENT_SECRET")))
@if (is_null(Auth::user()->discordUser) && strtolower($force_discord_verification) == 'true')
@if (!empty(config('SETTINGS::DISCORD:CLIENT_ID')) && !empty(config('SETTINGS::DISCORD:CLIENT_SECRET')))
<div class="alert alert-warning p-2 m-2">
<h5><i class="icon fas fa-exclamation-circle"></i>{{__('Required Discord verification!')}}</h5>
{{__('You have not yet verified your discord account')}}
<a class="text-primary" href="{{route('auth.redirect')}}">{{__('Login with discord')}}</a> <br>
{{__('Please contact support If you face any issues.')}}
<h5><i
class="icon fas fa-exclamation-circle"></i>{{ __('Required Discord verification!') }}
</h5>
{{ __('You have not yet verified your discord account') }}
<a class="text-primary"
href="{{ route('auth.redirect') }}">{{ __('Login with discord') }}</a> <br>
{{ __('Please contact support If you face any issues.') }}
</div>
@else
<div class="alert alert-danger p-2 m-2">
<h5><i class="icon fas fa-exclamation-circle"></i>{{__('Required Discord verification!')}}</h5>
{{__('Due to system settings you are required to verify your discord account!')}} <br>
{{__('It looks like this hasnt been set-up correctly! Please contact support.')}}'
<h5><i
class="icon fas fa-exclamation-circle"></i>{{ __('Required Discord verification!') }}
</h5>
{{ __('Due to system settings you are required to verify your discord account!') }} <br>
{{ __('It looks like this hasnt been set-up correctly! Please contact support.') }}'
</div>
@endif
@endif
@ -55,7 +64,7 @@
</div>
</div>
<form class="form" action="{{route('profile.update' , Auth::user()->id)}}" method="post">
<form class="form" action="{{ route('profile.update', Auth::user()->id) }}" method="post">
@csrf
@method('PATCH')
<div class="card">
@ -64,42 +73,42 @@
<div class="row">
<div class="col-12 col-sm-auto mb-4">
<div class="slim rounded-circle border-secondary border text-gray-dark"
data-label="Change your avatar"
data-max-file-size="3"
data-save-initial-image="true"
style="width: 140px;height:140px; cursor: pointer"
data-size="140,140">
<img src="{{$user->getAvatar()}}" alt="avatar">
data-label="Change your avatar" data-max-file-size="3"
data-save-initial-image="true" style="width: 140px;height:140px; cursor: pointer"
data-size="140,140">
<img src="{{ $user->getAvatar() }}" alt="avatar">
</div>
</div>
<div class="col d-flex flex-column flex-sm-row justify-content-between mb-3">
<div class="text-center text-sm-left mb-2 mb-sm-0"><h4
class="pt-sm-2 pb-1 mb-0 text-nowrap">{{$user->name}}</h4>
<p class="mb-0">{{$user->email}}
@if($user->hasVerifiedEmail())
<div class="text-center text-sm-left mb-2 mb-sm-0">
<h4 class="pt-sm-2 pb-1 mb-0 text-nowrap">{{ $user->name }}</h4>
<p class="mb-0">{{ $user->email }}
@if ($user->hasVerifiedEmail())
<i data-toggle="popover" data-trigger="hover" data-content="Verified"
class="text-success fas fa-check-circle"></i>
class="text-success fas fa-check-circle"></i>
@else
<i data-toggle="popover" data-trigger="hover"
data-content="Not verified"
class="text-danger fas fa-exclamation-circle"></i>
<i data-toggle="popover" data-trigger="hover" data-content="Not verified"
class="text-danger fas fa-exclamation-circle"></i>
@endif
</p>
<div class="mt-1">
<span class="badge badge-primary"><i class="fa fa-coins mr-2"></i>{{$user->Credits()}}</span>
<span class="badge badge-primary"><i
class="fa fa-coins mr-2"></i>{{ $user->Credits() }}</span>
</div>
</div>
<div class="text-center text-sm-right"><span
class="badge badge-secondary">{{$user->role}}</span>
<div class="text-muted"><small>{{$user->created_at->isoFormat('LL')}}</small>
class="badge badge-secondary">{{ $user->role }}</span>
<div class="text-muted">
<small>{{ $user->created_at->isoFormat('LL') }}</small>
</div>
</div>
</div>
</div>
<ul class="nav nav-tabs">
<li class="nav-item"><a href="javasript:void(0)" class="active nav-link">{{__('Settings')}}</a>
<li class="nav-item"><a href="javasript:void(0)"
class="active nav-link">{{ __('Settings') }}</a>
</li>
</ul>
<div class="tab-content pt-3">
@ -108,31 +117,30 @@
<div class="col">
<div class="row">
<div class="col">
<div class="form-group"><label>{{__('Name')}}</label> <input
<div class="form-group"><label>{{ __('Name') }}</label> <input
class="form-control @error('name') is-invalid @enderror"
type="text" name="name"
placeholder="{{$user->name}}" value="{{$user->name}}">
type="text" name="name" placeholder="{{ $user->name }}"
value="{{ $user->name }}">
@error('name')
<div class="invalid-feedback">
{{$message}}
</div>
<div class="invalid-feedback">
{{ $message }}
</div>
@enderror
</div>
</div>
</div>
<div class="row">
<div class="col">
<div class="form-group"><label>{{__('Email')}}</label> <input
<div class="form-group"><label>{{ __('Email') }}</label> <input
class="form-control @error('email') is-invalid @enderror"
type="text"
placeholder="{{$user->email}}" name="email"
value="{{$user->email}}">
type="text" placeholder="{{ $user->email }}" name="email"
value="{{ $user->email }}">
@error('email')
<div class="invalid-feedback">
{{$message}}
</div>
<div class="invalid-feedback">
{{ $message }}
</div>
@enderror
</div>
</div>
@ -141,92 +149,97 @@
</div>
<div class="row">
<div class="col-12 col-sm-6 mb-3">
<div class="mb-3"><b>{{__('Change Password')}}</b></div>
<div class="mb-3"><b>{{ __('Change Password') }}</b></div>
<div class="row">
<div class="col">
<div class="form-group"><label>{{__('Current Password')}}</label> <input
<div class="form-group">
<label>{{ __('Current Password') }}</label>
<input
class="form-control @error('current_password') is-invalid @enderror"
name="current_password" type="password"
placeholder="••••••">
name="current_password" type="password" placeholder="••••••">
@error('current_password')
<div class="invalid-feedback">
{{$message}}
</div>
<div class="invalid-feedback">
{{ $message }}
</div>
@enderror
</div>
</div>
</div>
<div class="row">
<div class="col">
<div class="form-group"><label>{{__('New Password')}}</label> <input
<div class="form-group"><label>{{ __('New Password') }}</label>
<input
class="form-control @error('new_password') is-invalid @enderror"
name="new_password" type="password" placeholder="••••••">
@error('new_password')
<div class="invalid-feedback">
{{$message}}
</div>
<div class="invalid-feedback">
{{ $message }}
</div>
@enderror
</div>
</div>
</div>
<div class="row">
<div class="col">
<div class="form-group"><label>{{__('Confirm Password')}}</span></label>
<div class="form-group">
<label>{{ __('Confirm Password') }}</span></label>
<input
class="form-control @error('new_password_confirmation') is-invalid @enderror"
name="new_password_confirmation" type="password"
placeholder="••••••">
@error('new_password_confirmation')
<div class="invalid-feedback">
{{$message}}
</div>
<div class="invalid-feedback">
{{ $message }}
</div>
@enderror
</div>
</div>
</div>
</div>
@if(!empty(\App\Models\Settings::getValueByKey("SETTINGS::DISCORD:CLIENT_ID")) && !empty(\App\Models\Settings::getValueByKey("SETTINGS::DISCORD:CLIENT_SECRET")))
<div class="col-12 col-sm-5 offset-sm-1 mb-3">
@if(is_null(Auth::user()->discordUser))
<b>{{__('Link your discord account!')}}</b>
@if (!empty(config('SETTINGS::DISCORD:CLIENT_ID')) && !empty(config('SETTINGS::DISCORD:CLIENT_SECRET')))
<div class="col-12 col-sm-5 offset-sm-1 mb-3">
@if (is_null(Auth::user()->discordUser))
<b>{{ __('Link your discord account!') }}</b>
<div class="verify-discord">
<div class="mb-3">
@if($credits_reward_after_verify_discord)
<p>{{__('By verifying your discord account, you receive extra Credits and increased Server amounts')}}
@if ($credits_reward_after_verify_discord)
<p>{{ __('By verifying your discord account, you receive extra Credits and increased Server amounts') }}
</p>
@endif
</div>
</div>
<a class="btn btn-light" href="{{route('auth.redirect')}}">
<i class="fab fa-discord mr-2"></i>{{__('Login with Discord')}}
<a class="btn btn-light" href="{{ route('auth.redirect') }}">
<i class="fab fa-discord mr-2"></i>{{ __('Login with Discord') }}
</a>
@else
<div class="verified-discord">
<div class="my-3 callout callout-info">
<p>{{__('You are verified!')}}</p>
<p>{{ __('You are verified!') }}</p>
</div>
</div>
<div class="row pl-2">
<div class="small-box bg-dark">
<div class="d-flex justify-content-between">
<div class="p-3">
<h3>{{$user->discordUser->username}}
<sup>{{$user->discordUser->locale}}</sup></h3>
<p>{{$user->discordUser->id}}
<h3>{{ $user->discordUser->username }}
<sup>{{ $user->discordUser->locale }}</sup>
</h3>
<p>{{ $user->discordUser->id }}
</p>
</div>
<div class="p-3"><img width="100px" height="100px"
class="rounded-circle"
src="{{$user->discordUser->getAvatar()}}"
alt="avatar"></div>
<div class="p-3"><img width="100px"
height="100px" class="rounded-circle"
src="{{ $user->discordUser->getAvatar() }}"
alt="avatar"></div>
</div>
<div class="small-box-footer">
<a href="{{route('auth.redirect')}}">
<i class="fab fa-discord mr-1"></i>{{__('Re-Sync Discord')}}
<a href="{{ route('auth.redirect') }}">
<i
class="fab fa-discord mr-1"></i>{{ __('Re-Sync Discord') }}
</a>
</div>
</div>
@ -238,7 +251,8 @@
</div>
<div class="row">
<div class="col d-flex justify-content-end">
<button class="btn btn-primary" type="submit">{{__('Save Changes')}}</button>
<button class="btn btn-primary"
type="submit">{{ __('Save Changes') }}</button>
</div>
</div>

View file

@ -55,8 +55,8 @@
</a>
<div class="dropdown-menu dropdown-menu-right shadow animated--fade-in"
aria-labelledby="dropdownMenuLink">
@if (!empty(\App\Models\Settings::getValueByKey("SETTINGS::MISC:PHPMYADMIN:URL")))
<a href="{{\App\Models\Settings::getValueByKey("SETTINGS::MISC:PHPMYADMIN:URL") }}"
@if (!empty(config('SETTINGS::MISC:PHPMYADMIN:URL')))
<a href="{{ config('SETTINGS::MISC:PHPMYADMIN:URL') }}"
class="dropdown-item text-info" target="__blank"><i title="manage"
class="fas fa-database mr-2"></i><span>{{ __('Database') }}</span></a>
@endif
@ -149,7 +149,7 @@
</div>
<div class="card-footer d-flex align-items-center justify-content-between">
<a href="{{ \App\Models\Settings::getValueByKey("SETTINGS::SYSTEM:PTERODACTYL:URL") }}/server/{{ $server->identifier }}"
<a href="{{ config('SETTINGS::SYSTEM:PTERODACTYL:URL') }}/server/{{ $server->identifier }}"
target="__blank"
class="btn btn-info mx-3 w-100 align-items-center justify-content-center d-flex">
<i class="fas fa-tools mr-2"></i>

View file

@ -78,7 +78,7 @@
<p class="lead">{{ __('Payment Methods') }}:</p>
<div>
@if (\App\Models\Settings::getValueByKey("SETTINGS::PAYMENTS:PAYPAL:SECRET")|| \App\Models\Settings::getValueByKey("SETTINGS::PAYMENTS:PAYPAL:SANDBOX_SECRET"))
@if (config('SETTINGS::PAYMENTS:PAYPAL:SECRET') || config('SETTINGS::PAYMENTS:PAYPAL:SANDBOX_SECRET'))
<label class="text-center " for="paypal">
<img class="mb-3" height="50"
src="{{ url('/images/paypal_logo.png') }}"></br>
@ -88,7 +88,7 @@
</input>
</label>
@endif
@if (\App\Models\Settings::getValueByKey("SETTINGS::PAYMENTS:STRIPE:TEST_SECRET") || \App\Models\Settings::getValueByKey("SETTINGS::PAYMENTS:STRIPE:SECRET"))
@if (config('SETTINGS::PAYMENTS:STRIPE:TEST_SECRET') || config('SETTINGS::PAYMENTS:STRIPE:SECRET'))
<label class="ml-5 text-center " for="stripe">
<img class="mb-3" height="50"
src="{{ url('/images/stripe_logo.png') }}" /></br>