feat: ✨ Allow value column in table to be nullable -> can store "0" values
This commit is contained in:
parent
1e085982af
commit
4621547c01
|
@ -33,9 +33,7 @@ class Invoices
|
||||||
|
|
||||||
foreach ($values as $key => $value) {
|
foreach ($values as $key => $value) {
|
||||||
$param = $request->get($value);
|
$param = $request->get($value);
|
||||||
if (!$param) {
|
|
||||||
$param = "";
|
|
||||||
}
|
|
||||||
Settings::where('key', $key)->updateOrCreate(['key' => $key], ['value' => $param]);
|
Settings::where('key', $key)->updateOrCreate(['key' => $key], ['value' => $param]);
|
||||||
Cache::forget("setting" . ':' . $key);
|
Cache::forget("setting" . ':' . $key);
|
||||||
}
|
}
|
||||||
|
@ -46,6 +44,6 @@ class Invoices
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return redirect(route('admin.settings.index') . '#invoices')->with('success', 'Invoice settings updated!');
|
return redirect(route('admin.settings.index') . '#invoices')->with('success', __('Invoice settings updated!'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,15 +30,13 @@ class Language
|
||||||
|
|
||||||
foreach ($values as $key => $value) {
|
foreach ($values as $key => $value) {
|
||||||
$param = $request->get($value);
|
$param = $request->get($value);
|
||||||
if (!$param) {
|
|
||||||
$param = "false";
|
|
||||||
}
|
|
||||||
Settings::where('key', $key)->updateOrCreate(['key' => $key], ['value' => $param]);
|
Settings::where('key', $key)->updateOrCreate(['key' => $key], ['value' => $param]);
|
||||||
Cache::forget("setting" . ':' . $key);
|
Cache::forget("setting" . ':' . $key);
|
||||||
Session::remove("locale");
|
Session::remove("locale");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return redirect(route('admin.settings.index') . '#language')->with('success', 'Language settings updated!');
|
return redirect(route('admin.settings.index') . '#language')->with('success', __('Language settings updated!'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,14 +35,12 @@ class Payments
|
||||||
|
|
||||||
foreach ($values as $key => $value) {
|
foreach ($values as $key => $value) {
|
||||||
$param = $request->get($value);
|
$param = $request->get($value);
|
||||||
if (!$param) {
|
|
||||||
$param = "";
|
|
||||||
}
|
|
||||||
Settings::where('key', $key)->updateOrCreate(['key' => $key], ['value' => $param]);
|
Settings::where('key', $key)->updateOrCreate(['key' => $key], ['value' => $param]);
|
||||||
Cache::forget("setting" . ':' . $key);
|
Cache::forget("setting" . ':' . $key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return redirect(route('admin.settings.index') . '#payment')->with('success', 'Payment settings updated!');
|
return redirect(route('admin.settings.index') . '#payment')->with('success', __('Payment settings updated!'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,34 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
class UpdateSettingsTableAllowNullable extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
//allow value column in settings table to be nullable
|
||||||
|
Schema::table('settings', function (Blueprint $table) {
|
||||||
|
$table->string('value')->nullable()->change();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
//disallow value column in settings table to be nullable
|
||||||
|
Schema::table('settings', function (Blueprint $table) {
|
||||||
|
$table->string('value')->nullable(false)->change();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
|
@ -73,20 +73,19 @@
|
||||||
var fileName = $(this).val().split("\\").pop();
|
var fileName = $(this).val().split("\\").pop();
|
||||||
$(this).siblings(".custom-file-label").addClass("selected").html(fileName);
|
$(this).siblings(".custom-file-label").addClass("selected").html(fileName);
|
||||||
});
|
});
|
||||||
|
|
||||||
const tabPaneHash = window.location.hash;
|
|
||||||
if (tabPaneHash) {
|
|
||||||
$('.nav-tabs a[href="' + tabPaneHash + '"]').tab('show');
|
|
||||||
}
|
|
||||||
|
|
||||||
$('.nav-tabs a').click(function(e) {
|
|
||||||
$(this).tab('show');
|
|
||||||
const scrollmem = $('body').scrollTop();
|
|
||||||
window.location.hash = this.hash;
|
|
||||||
$('html,body').scrollTop(scrollmem);
|
|
||||||
});
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const tabPaneHash = window.location.hash;
|
||||||
|
if (tabPaneHash) {
|
||||||
|
$('.nav-tabs a[href="' + tabPaneHash + '"]').tab('show');
|
||||||
|
}
|
||||||
|
|
||||||
|
$('.nav-tabs a').click(function(e) {
|
||||||
|
$(this).tab('show');
|
||||||
|
const scrollmem = $('body').scrollTop();
|
||||||
|
window.location.hash = this.hash;
|
||||||
|
$('html,body').scrollTop(scrollmem);
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -88,20 +88,19 @@
|
||||||
|
|
||||||
<div class="form-group mb-3">
|
<div class="form-group mb-3">
|
||||||
<div class="custom-control p-0">
|
<div class="custom-control p-0">
|
||||||
<label for="discord-client-id">{{ __('ReCaptcha Site-Key') }}:</label>
|
<label for="recaptcha-site-key">{{ __('ReCaptcha Site-Key') }}:</label>
|
||||||
<input x-model="ReCaptcha-client-id" id="ReCaptcha-client-id" name="ReCaptcha-client-id"
|
<input x-model="recaptcha-site-key" id="recaptcha-site-key" name="recaptcha-site-key"
|
||||||
type="text" value="{{ config('SETTINGS::RECAPTCHA:SITE_KEY') }}"
|
type="text" value="{{ config('SETTINGS::RECAPTCHA:SITE_KEY') }}"
|
||||||
class="form-control @error('ReCaptcha-client-id') is-invalid @enderror">
|
class="form-control @error('recaptcha-site-key') is-invalid @enderror">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group mb-3">
|
<div class="form-group mb-3">
|
||||||
<div class="custom-control p-0">
|
<div class="custom-control p-0">
|
||||||
<label for="ReCaptcha-client-secret">{{ __('ReCaptcha Secret-Key') }}:</label>
|
<label for="recaptcha-secret-key">{{ __('ReCaptcha Secret-Key') }}:</label>
|
||||||
<input x-model="ReCaptcha-client-secret" id="recaptcha-client-secret"
|
<input x-model="recaptcha-secret-key" id="recaptcha-secret-key" name="recaptcha-secret-key"
|
||||||
name="ReCaptcha-client-secret" type="text"
|
type="text" value="{{ config('SETTINGS::RECAPTCHA:SECRET_KEY') }}"
|
||||||
value="{{ config('SETTINGS::RECAPTCHA:SECRET_KEY') }}"
|
class="form-control @error('recaptcha-secret-key') is-invalid @enderror">
|
||||||
class="form-control @error('ReCaptcha-client-secret') is-invalid @enderror">
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -103,14 +103,14 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="custom-control mb-3 p-0">
|
<div class="custom-control mb-3 p-0">
|
||||||
<label for="server-limit-discord">{{ __('Server Limit Increase - Discord') }}</label>
|
<label for="server-limit-discord">{{ __('Server Limit Increase - Discord') }}</label>
|
||||||
<input x-model="server-limit-discord" id="server-limit-discord" name="crserver-limit-discord"
|
<input x-model="server-limit-discord" id="server-limit-discord" name="server-limit-discord"
|
||||||
type="number"
|
type="number"
|
||||||
value="{{ config('SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_DISCORD') }}"
|
value="{{ config('SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_DISCORD') }}"
|
||||||
class="form-control @error('server-limit-discord') is-invalid @enderror" required>
|
class="form-control @error('server-limit-discord') is-invalid @enderror" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="custom-control mb-3 p-0">
|
<div class="custom-control mb-3 p-0">
|
||||||
<label for="server-limit-email">{{ __('Server Limit Increase - E-Mail') }}</label>
|
<label for="server-limit-email">{{ __('Server Limit Increase - E-Mail') }}</label>
|
||||||
<input x-model="server-limit-email" id="server-limit-email" name="crserver-limit-email"
|
<input x-model="server-limit-email" id="server-limit-email" name="server-limit-email"
|
||||||
type="number"
|
type="number"
|
||||||
value="{{ config('SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_EMAIL') }}"
|
value="{{ config('SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_EMAIL') }}"
|
||||||
class="form-control @error('server-limit-email') is-invalid @enderror" required>
|
class="form-control @error('server-limit-email') is-invalid @enderror" required>
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
<noscript>
|
<noscript>
|
||||||
<link rel="stylesheet" href="{{ asset('plugins/fontawesome-free/css/all.min.css') }}">
|
<link rel="stylesheet" href="{{ asset('plugins/fontawesome-free/css/all.min.css') }}">
|
||||||
</noscript>
|
</noscript>
|
||||||
|
<script src="{{ asset('js/app.js') }}"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="sidebar-mini layout-fixed dark-mode" style="height: auto;">
|
<body class="sidebar-mini layout-fixed dark-mode" style="height: auto;">
|
||||||
|
@ -49,8 +50,8 @@
|
||||||
class="fas fa-home mr-2"></i>{{ __('Home') }}</a>
|
class="fas fa-home mr-2"></i>{{ __('Home') }}</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item d-none d-sm-inline-block">
|
<li class="nav-item d-none d-sm-inline-block">
|
||||||
<a href="{{ config('SETTINGS::DISCORD:INVITE_URL') }}" class="nav-link"
|
<a href="{{ config('SETTINGS::DISCORD:INVITE_URL') }}" class="nav-link" target="__blank"><i
|
||||||
target="__blank"><i class="fab fa-discord mr-2"></i>{{ __('Discord') }}</a>
|
class="fab fa-discord mr-2"></i>{{ __('Discord') }}</a>
|
||||||
</li>
|
</li>
|
||||||
<!-- Language Selection -->
|
<!-- Language Selection -->
|
||||||
@if (config('SETTINGS::LOCALE:CLIENTS_CAN_CHANGE') == 'true')
|
@if (config('SETTINGS::LOCALE:CLIENTS_CAN_CHANGE') == 'true')
|
||||||
|
@ -390,7 +391,7 @@
|
||||||
{{-- <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script> --}}
|
{{-- <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script> --}}
|
||||||
{{-- <script src="{{ asset('js/adminlte.min.js') }}"></script> --}}
|
{{-- <script src="{{ asset('js/adminlte.min.js') }}"></script> --}}
|
||||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@10.14.1/dist/sweetalert2.all.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@10.14.1/dist/sweetalert2.all.min.js"></script>
|
||||||
<script src="{{ asset('js/app.js') }}"></script>
|
|
||||||
<script type="text/javascript" src="https://cdn.datatables.net/v/bs4/dt-1.10.24/datatables.min.js"></script>
|
<script type="text/javascript" src="https://cdn.datatables.net/v/bs4/dt-1.10.24/datatables.min.js"></script>
|
||||||
<!-- Summernote -->
|
<!-- Summernote -->
|
||||||
<script src="{{ asset('plugins/summernote/summernote-bs4.min.js') }}"></script>
|
<script src="{{ asset('plugins/summernote/summernote-bs4.min.js') }}"></script>
|
||||||
|
@ -404,17 +405,17 @@
|
||||||
<script src="{{ asset('plugins/tempusdominus-bootstrap-4/js/tempusdominus-bootstrap-4.min.js') }}"></script>
|
<script src="{{ asset('plugins/tempusdominus-bootstrap-4/js/tempusdominus-bootstrap-4.min.js') }}"></script>
|
||||||
|
|
||||||
<!-- Select2 -->
|
<!-- Select2 -->
|
||||||
<script src={{ asset('plugins/select2/js/select2.min.js') }}>
|
<script src={{ asset('plugins/select2/js/select2.min.js') }}></script>
|
||||||
< script >
|
<script>
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$('[data-toggle="popover"]').popover();
|
$('[data-toggle="popover"]').popover();
|
||||||
|
|
||||||
$.ajaxSetup({
|
$.ajaxSetup({
|
||||||
headers: {
|
headers: {
|
||||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||||
}
|
}
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
@if (Session::has('error'))
|
@if (Session::has('error'))
|
||||||
|
|
Loading…
Reference in a new issue