From cd91931bc0f4b7ce360e84b67662e1ae839dd714 Mon Sep 17 00:00:00 2001 From: IceToast Date: Sun, 2 Jan 2022 19:34:51 +0100 Subject: [PATCH 01/60] =?UTF-8?q?feat:=20=F0=9F=8E=A8=20Moved=20Settingsco?= =?UTF-8?q?ntroller=20to=20their=20own=20directory?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InvoiceSettingsController.php | 79 +++++++++++++++++++ .../SettingsController.php | 24 ++++-- 2 files changed, 98 insertions(+), 5 deletions(-) create mode 100644 app/Http/Controllers/Admin/SettingsControllers/InvoiceSettingsController.php rename app/Http/Controllers/Admin/{ => SettingsControllers}/SettingsController.php (77%) diff --git a/app/Http/Controllers/Admin/SettingsControllers/InvoiceSettingsController.php b/app/Http/Controllers/Admin/SettingsControllers/InvoiceSettingsController.php new file mode 100644 index 00000000..7281709a --- /dev/null +++ b/app/Http/Controllers/Admin/SettingsControllers/InvoiceSettingsController.php @@ -0,0 +1,79 @@ +invoiceSettings = InvoiceSettings::first(); + } + + public function index() + { + return view('admin.settings.tabs.invoice', [ + 'invoiceSettings' => $this->invoiceSettings, + ]); + } + + public function updateInvoiceSettings(Request $request) + { + $request->validate([ + 'logo' => 'nullable|max:10000|mimes:jpg,png,jpeg', + ]); + + InvoiceSettings::updateOrCreate([ + 'id' => "1" + ], [ + 'company_name' => $request->get('company-name'), + 'company_adress' => $request->get('company-address'), + 'company_phone' => $request->get('company-phone'), + 'company_mail' => $request->get('company-mail'), + 'company_vat' => $request->get('company-vat'), + 'company_web' => $request->get('company-web'), + 'invoice_prefix' => $request->get('invoice-prefix'), + ]); + + if ($request->hasFile('logo')) { + $request->file('logo')->storeAs('public', 'logo.png'); + } + + + return redirect()->route('admin.settings.index')->with('success', 'Invoice settings updated!'); + } + + public function downloadAllInvoices() + { + $zip = new ZipArchive; + $zip_safe_path = storage_path('invoices.zip'); + $res = $zip->open($zip_safe_path, ZipArchive::CREATE | ZipArchive::OVERWRITE); + $result = $this::rglob(storage_path('app/invoice/*')); + if ($res === TRUE) { + $zip->addFromString("1. Info.txt", "This Archive contains all Invoices from all Users!\nIf there are no Invoices here, no Invoices have ever been created!"); + foreach ($result as $file) { + if (file_exists($file) && is_file($file)) { + $zip->addFile($file, basename($file)); + } + } + $zip->close(); + } + return response()->download($zip_safe_path); + } + + public function rglob($pattern, $flags = 0) + { + $files = glob($pattern, $flags); + foreach (glob(dirname($pattern) . '/*', GLOB_ONLYDIR | GLOB_NOSORT) as $dir) { + $files = array_merge($files, $this::rglob($dir . '/' . basename($pattern), $flags)); + } + return $files; + } +} diff --git a/app/Http/Controllers/Admin/SettingsController.php b/app/Http/Controllers/Admin/SettingsControllers/SettingsController.php similarity index 77% rename from app/Http/Controllers/Admin/SettingsController.php rename to app/Http/Controllers/Admin/SettingsControllers/SettingsController.php index aeabd3d5..b12d8416 100644 --- a/app/Http/Controllers/Admin/SettingsController.php +++ b/app/Http/Controllers/Admin/SettingsControllers/SettingsController.php @@ -1,6 +1,6 @@ toArray()); + // + + //Generate a html list item for each tab based on tabs file basename + $tabsListItem = []; + foreach ($tabs as $tab) { + $tabsListItem[] = ''; + } + + return view('admin.settings.index', [ + 'tabs' => $tabs, + ]);; } public function updateIcons(Request $request) @@ -96,5 +111,4 @@ class SettingsController extends Controller } return $files; } - } From 41b0f032194b1deb84992ec9f943efe9dbe3c90b Mon Sep 17 00:00:00 2001 From: IceToast Date: Sun, 2 Jan 2022 19:37:31 +0100 Subject: [PATCH 02/60] =?UTF-8?q?refactor:=20=E2=99=BB=EF=B8=8F=20Removed?= =?UTF-8?q?=20commented=20out=20code=20&=20Renamed=20SettingsController=20?= =?UTF-8?q?&=20comments=20for=20readability?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- routes/web.php | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/routes/web.php b/routes/web.php index 603cb5e7..178dadcd 100644 --- a/routes/web.php +++ b/routes/web.php @@ -8,7 +8,7 @@ use App\Http\Controllers\Admin\PaymentController; use App\Http\Controllers\Admin\CreditProductController; use App\Http\Controllers\Admin\ProductController; use App\Http\Controllers\Admin\ServerController as AdminServerController; -use App\Http\Controllers\Admin\SettingsController; +use App\Http\Controllers\Admin\SettingsControllers\SettingsController; use App\Http\Controllers\Admin\UsefulLinkController; use App\Http\Controllers\Admin\UserController; use App\Http\Controllers\Admin\VoucherController; @@ -72,8 +72,6 @@ Route::middleware(['auth', 'checkSuspended'])->group(function () { Route::get('payment/StripeSuccess', [PaymentController::class, 'StripeSuccess'])->name('payment.StripeSuccess'); Route::get('payment/Cancel', [PaymentController::class, 'Cancel'])->name('payment.Cancel'); - - Route::get('users/logbackin', [UserController::class, 'logBackIn'])->name('users.logbackin'); #discord @@ -85,14 +83,18 @@ Route::middleware(['auth', 'checkSuspended'])->group(function () { #switch language Route::post('changelocale', [TranslationController::class, 'changeLocale'])->name('changeLocale'); + + #admin Route::prefix('admin')->name('admin.')->middleware('admin')->group(function () { + #overview Route::get('overview', [OverViewController::class, 'index'])->name('overview.index'); Route::get('overview/sync', [OverViewController::class, 'syncPterodactyl'])->name('overview.sync'); Route::resource('activitylogs', ActivityLogController::class); + #users Route::get("users.json", [UserController::class, "json"])->name('users.json'); Route::get('users/loginas/{user}', [UserController::class, 'loginAs'])->name('users.loginas'); Route::get('users/datatable', [UserController::class, 'datatable'])->name('users.datatable'); @@ -101,50 +103,51 @@ Route::middleware(['auth', 'checkSuspended'])->group(function () { Route::post('users/togglesuspend/{user}', [UserController::class, 'toggleSuspended'])->name('users.togglesuspend'); Route::resource('users', UserController::class); + #servers Route::get('servers/datatable', [AdminServerController::class, 'datatable'])->name('servers.datatable'); Route::post('servers/togglesuspend/{server}', [AdminServerController::class, 'toggleSuspended'])->name('servers.togglesuspend'); Route::resource('servers', AdminServerController::class); + #products Route::get('products/datatable', [ProductController::class, 'datatable'])->name('products.datatable'); Route::get('products/clone/{product}', [ProductController::class, 'clone'])->name('products.clone'); Route::patch('products/disable/{product}', [ProductController::class, 'disable'])->name('products.disable'); Route::resource('products', ProductController::class); + #store Route::get('store/datatable', [CreditProductController::class, 'datatable'])->name('store.datatable'); Route::patch('store/disable/{creditProduct}', [CreditProductController::class, 'disable'])->name('store.disable'); Route::resource('store', CreditProductController::class)->parameters([ 'store' => 'creditProduct', ]); + #payments Route::get('payments/datatable', [PaymentController::class, 'datatable'])->name('payments.datatable'); Route::get('payments', [PaymentController::class, 'index'])->name('payments.index'); -// Route::get('nodes/datatable', [NodeController::class, 'datatable'])->name('nodes.datatable'); -// Route::get('nodes/sync', [NodeController::class, 'sync'])->name('nodes.sync'); -// Route::resource('nodes', NodeController::class); -// -// Route::get('nests/datatable', [NestsController::class, 'datatable'])->name('nests.datatable'); -// Route::get('nests/sync', [NestsController::class, 'sync'])->name('nests.sync'); -// Route::resource('nests', NestsController::class); - + #configuration Route::get('configurations/datatable', [ConfigurationController::class, 'datatable'])->name('configurations.datatable'); Route::patch('configurations/updatevalue', [ConfigurationController::class, 'updatevalue'])->name('configurations.updatevalue'); Route::resource('configurations', ConfigurationController::class); Route::resource('configurations', ConfigurationController::class); + #settings Route::patch('settings/update/icons', [SettingsController::class, 'updateIcons'])->name('settings.update.icons'); Route::patch('settings/update/invoice-settings', [SettingsController::class, 'updateInvoiceSettings'])->name('settings.update.invoicesettings'); Route::get('settings/download-invoices', [SettingsController::class, 'downloadAllInvoices'])->name('settings.downloadAllInvoices');; Route::resource('settings', SettingsController::class)->only('index'); + #usefullinks Route::get('usefullinks/datatable', [UsefulLinkController::class, 'datatable'])->name('usefullinks.datatable'); Route::resource('usefullinks', UsefulLinkController::class); + #vouchers Route::get('vouchers/datatable', [VoucherController::class, 'datatable'])->name('vouchers.datatable'); Route::get('vouchers/{voucher}/usersdatatable', [VoucherController::class, 'usersdatatable'])->name('vouchers.usersdatatable'); Route::get('vouchers/{voucher}/users', [VoucherController::class, 'users'])->name('vouchers.users'); Route::resource('vouchers', VoucherController::class); + #api-keys Route::get('api/datatable', [ApplicationApiController::class, 'datatable'])->name('api.datatable'); Route::resource('api', ApplicationApiController::class)->parameters([ 'api' => 'applicationApi', From ef732d542645ce8fe65ab030b9c76737e72d639d Mon Sep 17 00:00:00 2001 From: IceToast Date: Sun, 2 Jan 2022 19:38:13 +0100 Subject: [PATCH 03/60] =?UTF-8?q?feat:=20=E2=9C=A8=20Moved=20InvoiceSettin?= =?UTF-8?q?gs=20Tab=20content=20to=20"tabs"=20directory=20->=20modular=20a?= =?UTF-8?q?pproach?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/admin/settings/index.blade.php | 156 ++++-------------- .../admin/settings/tabs/invoice.blade.php | 101 ++++++++++++ 2 files changed, 130 insertions(+), 127 deletions(-) create mode 100644 resources/views/admin/settings/tabs/invoice.blade.php diff --git a/resources/views/admin/settings/index.blade.php b/resources/views/admin/settings/index.blade.php index e3ecb1c3..368431eb 100644 --- a/resources/views/admin/settings/index.blade.php +++ b/resources/views/admin/settings/index.blade.php @@ -6,13 +6,13 @@
-

{{__('Settings')}}

+

{{ __('Settings') }}

@@ -28,7 +28,7 @@
-
{{__('Settings')}}
+
{{ __('Settings') }}
@@ -37,10 +37,15 @@ @@ -49,7 +54,7 @@
+ action="{{ route('admin.settings.update.icons') }}"> @csrf @method('PATCH') @@ -58,147 +63,44 @@
+ class="custom-file-input" name="icon" id="icon"> + for="icon">{{ __('Select panel icon') }}
@error('icon') - - {{$message}} - + + {{ $message }} + @enderror
+ name="favicon" id="favicon"> + for="favicon">{{ __('Select panel favicon') }}
@error('favicon') - - {{$message}} - + + {{ $message }} + @enderror
- + -

Images and Icons may be cached, use CNTRL + F5(google +

Images and Icons may be cached, use CNTRL + + F5(google chrome hotkey) to reload without cache to see your changes appear :)

-
- - -
- @csrf - @method('PATCH') - -
-
- -
-
- - -
-
- -
-
- - -
-
- -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- -
-
- - -
-
- - -
-
- - -
-
- - -
-
- -
- - -
-
- @error('logo') - - {{$message}} - - @enderror -
-
-
- - - -
+ @foreach ($tabs as $tab) + @include($tab) + @endforeach @@ -219,7 +121,7 @@ diff --git a/resources/views/admin/configurations/index.blade.php b/resources/views/admin/configurations/index.blade.php deleted file mode 100644 index bed5435f..00000000 --- a/resources/views/admin/configurations/index.blade.php +++ /dev/null @@ -1,91 +0,0 @@ -@extends('layouts.main') - -@section('content') - -
-
-
-
-

{{__('Configurations')}}

-
- -
-
-
- - - -
-
- -
- -
-
-
{{__('Configurations')}}
-
-
- -
- - - - - - - - - - - - - - -
{{__('Key')}}{{__('Value')}}{{__('Type')}}{{__('Description')}}{{__('Created at')}}
- -
-
- - -
- - -
- - - @include('admin.configurations.editModel') - - - - - -@endsection diff --git a/resources/views/admin/settings/tabs/configurations.blade.php b/resources/views/admin/settings/tabs/configurations.blade.php new file mode 100644 index 00000000..526acd5d --- /dev/null +++ b/resources/views/admin/settings/tabs/configurations.blade.php @@ -0,0 +1,121 @@ +
+ + + + + + + + + + + + + +
{{ __('Key') }}{{ __('Value') }}{{ __('Type') }}{{ __('Description') }}{{ __('Created at') }}
+
+ + + + + + + + + diff --git a/resources/views/admin/settings/tabs/dashboard.blade.php b/resources/views/admin/settings/tabs/dashboard.blade.php index f6f25741..03171288 100644 --- a/resources/views/admin/settings/tabs/dashboard.blade.php +++ b/resources/views/admin/settings/tabs/dashboard.blade.php @@ -1,4 +1,4 @@ -
+
@csrf diff --git a/resources/views/layouts/main.blade.php b/resources/views/layouts/main.blade.php index 453258e6..6e34d263 100644 --- a/resources/views/layouts/main.blade.php +++ b/resources/views/layouts/main.blade.php @@ -1,5 +1,6 @@ + @@ -7,442 +8,439 @@ {{ config('app.name', 'Laravel') }} + href="{{ \Illuminate\Support\Facades\Storage::disk('public')->exists('favicon.ico') ? asset('storage/favicon.ico') : asset('favicon.ico') }}" + type="image/x-icon"> - {{-- --}} - + {{-- --}} + - {{-- summernote --}} - + {{-- summernote --}} + - {{-- datetimepicker --}} - + {{-- datetimepicker --}} + {{-- select2 --}} - + - - + + - -
- - + + + + - + -
- @if(!Auth::user()->hasVerifiedEmail()) - @if(Auth::user()->created_at->diffInHours(now(), false) > 1) -
-
{{__('Warning!')}}
- {{__('You have not yet verified your email address')}} {{__('Click here to resend verification email')}} -
- {{__('Please contact support If you didnt receive your verification email.')}} -
+ + + + + + + + + + + + + + + + + {{-- --}} + + {{-- --}} + + {{-- --}} + + + + + + + + + + + + + @endif + + + + +
+ + + + + +
+ + @if (!Auth::user()->hasVerifiedEmail()) + @if (Auth::user()->created_at->diffInHours(now(), false) > 1) +
+
{{ __('Warning!') }}
+ {{ __('You have not yet verified your email address') }} {{ __('Click here to resend verification email') }} +
+ {{ __('Please contact support If you didnt receive your verification email.') }} +
+ @endif @endif + + @yield('content') + + @include('models.redeem_voucher_modal') +
+ + + + + + +
+ + + + {{-- --}} + {{-- --}} + {{-- --}} + {{-- --}} + + + + + + + + + + + + + + + + + --}} -{{----}} -{{----}} -{{----}} - - - - - - - - - - - - - - - - - + } + }) + @endif + + diff --git a/routes/web.php b/routes/web.php index 178dadcd..e648508f 100644 --- a/routes/web.php +++ b/routes/web.php @@ -128,8 +128,6 @@ Route::middleware(['auth', 'checkSuspended'])->group(function () { #configuration Route::get('configurations/datatable', [ConfigurationController::class, 'datatable'])->name('configurations.datatable'); Route::patch('configurations/updatevalue', [ConfigurationController::class, 'updatevalue'])->name('configurations.updatevalue'); - Route::resource('configurations', ConfigurationController::class); - Route::resource('configurations', ConfigurationController::class); #settings Route::patch('settings/update/icons', [SettingsController::class, 'updateIcons'])->name('settings.update.icons'); From f056a183c74ad0fa762e353e57b624db5e6e5673 Mon Sep 17 00:00:00 2001 From: IceToast Date: Mon, 3 Jan 2022 02:10:36 +0100 Subject: [PATCH 07/60] =?UTF-8?q?chore:=20=F0=9F=8C=90=20localized=20"dash?= =?UTF-8?q?board=20icons=20string"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/lang/en.json | 22 +++++++------------ .../admin/settings/tabs/dashboard.blade.php | 6 ++--- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/resources/lang/en.json b/resources/lang/en.json index 0a2c40ef..fdc7563c 100644 --- a/resources/lang/en.json +++ b/resources/lang/en.json @@ -89,13 +89,6 @@ "Token": "Token", "Last used": "Last used", "Are you sure you wish to delete?": "Are you sure you wish to delete?", - "Edit Configuration": "Edit Configuration", - "Text Field": "Text Field", - "Cancel": "Cancel", - "Save": "Save", - "Configurations": "Configurations", - "Key": "Key", - "Value": "Value", "Nests": "Nests", "Sync": "Sync", "Active": "Active", @@ -151,10 +144,15 @@ "Config": "Config", "Suspended at": "Suspended at", "Settings": "Settings", - "Dashboard icons": "Dashboard icons", - "Invoice Settings": "Invoice Settings", + "Key": "Key", + "Value": "Value", + "Edit Configuration": "Edit Configuration", + "Text Field": "Text Field", + "Cancel": "Cancel", + "Save": "Save", "Select panel icon": "Select panel icon", "Select panel favicon": "Select panel favicon", + "Images and Icons may be cached, reload without cache to see your changes appear": "Images and Icons may be cached, reload without cache to see your changes appear", "Download all Invoices": "Download all Invoices", "Enter your companys name": "Enter your companys name", "Enter your companys address": "Enter your companys address", @@ -321,9 +319,6 @@ "Canceled ...": "Canceled ...", "Deletion has been canceled.": "Deletion has been canceled.", "Date": "Date", - "To": "To", - "From": "From", - "Pending": "Pending", "Subtotal": "Subtotal", "Payment Methods": "Payment Methods", "Amount Due": "Amount Due", @@ -349,6 +344,5 @@ "Total amount": "Total amount", "Notes": "Notes", "Amount in words": "Amount in words", - "Please pay until": "Please pay until", - "Account already exists on Pterodactyl. Please contact the Support!": "Account already exists on Pterodactyl. Please contact the Support!" + "Please pay until": "Please pay until" } \ No newline at end of file diff --git a/resources/views/admin/settings/tabs/dashboard.blade.php b/resources/views/admin/settings/tabs/dashboard.blade.php index 03171288..5c6f2902 100644 --- a/resources/views/admin/settings/tabs/dashboard.blade.php +++ b/resources/views/admin/settings/tabs/dashboard.blade.php @@ -36,8 +36,8 @@ -

Images and Icons may be cached, use CNTRL + - F5(google - chrome hotkey) to reload without cache to see your changes appear :)

+

+ {{ __('Images and Icons may be cached, reload without cache to see your changes appear') }} +

From acc3371ba8d2384ee652d43f4417c22ead0c9b7e Mon Sep 17 00:00:00 2001 From: 1Day Date: Tue, 4 Jan 2022 09:05:53 +0100 Subject: [PATCH 08/60] Download Invoices in Payment-View --- .../Controllers/Admin/InvoiceController.php | 70 +++++++++++++++++++ .../Controllers/Admin/PaymentController.php | 7 +- .../SettingsController.php | 27 ------- .../views/admin/payments/index.blade.php | 6 ++ .../admin/settings/tabs/invoice.blade.php | 4 -- routes/web.php | 6 +- 6 files changed, 87 insertions(+), 33 deletions(-) create mode 100644 app/Http/Controllers/Admin/InvoiceController.php diff --git a/app/Http/Controllers/Admin/InvoiceController.php b/app/Http/Controllers/Admin/InvoiceController.php new file mode 100644 index 00000000..bc20ef4c --- /dev/null +++ b/app/Http/Controllers/Admin/InvoiceController.php @@ -0,0 +1,70 @@ +open($zip_safe_path, ZipArchive::CREATE | ZipArchive::OVERWRITE); + $result = $this::rglob(storage_path('app/invoice/*')); + if ($res === TRUE) { + $zip->addFromString("1. Info.txt", __("Created at") . " " . now()->format("d.m.Y")); + foreach ($result as $file) { + if (file_exists($file) && is_file($file)) { + $zip->addFile($file, basename($file)); + } + } + $zip->close(); + } + return response()->download($zip_safe_path); + } + + /** + * @param $pattern + * @param $flags + * @return array|false + */ + public function rglob($pattern, $flags = 0) + { + $files = glob($pattern, $flags); + foreach (glob(dirname($pattern) . '/*', GLOB_ONLYDIR | GLOB_NOSORT) as $dir) { + $files = array_merge($files, $this::rglob($dir . '/' . basename($pattern), $flags)); + } + return $files; + } + + /** + * @param $paymentID + * @param $date + */ + public function downloadSingleInvoice(Request $request) + { + $id = $request->id; + try { + $query = Invoice::where('payment_id', '=', $id)->firstOrFail(); + } catch (Throwable $e) { + return redirect()->back()->with("error", __("Error!")); + } + + $invoice_path = storage_path('app/invoice/' . $query->invoice_user . '/' . $query->created_at->format("Y") . '/' . $query->invoice_name . '.pdf'); + + if (!file_exists($invoice_path)) { + return redirect()->back()->with("error", __("Error!")); + } + + + return response()->download($invoice_path); + + } + +} diff --git a/app/Http/Controllers/Admin/PaymentController.php b/app/Http/Controllers/Admin/PaymentController.php index ea7d3dd0..ff882da6 100644 --- a/app/Http/Controllers/Admin/PaymentController.php +++ b/app/Http/Controllers/Admin/PaymentController.php @@ -591,6 +591,11 @@ class PaymentController extends Controller ->editColumn('created_at', function (Payment $payment) { return $payment->created_at ? $payment->created_at->diffForHumans() : ''; }) - ->make(); + ->addColumn('actions', function (Payment $payment) { + return ' +'; + }) + ->rawColumns(['actions']) + ->make(true); } } diff --git a/app/Http/Controllers/Admin/SettingsControllers/SettingsController.php b/app/Http/Controllers/Admin/SettingsControllers/SettingsController.php index 0e0da944..cfc7a531 100644 --- a/app/Http/Controllers/Admin/SettingsControllers/SettingsController.php +++ b/app/Http/Controllers/Admin/SettingsControllers/SettingsController.php @@ -9,7 +9,6 @@ use Illuminate\Contracts\View\Factory; use Illuminate\Contracts\View\View; use Illuminate\Http\Request; use Illuminate\Http\Response; -use ZipArchive; class SettingsController extends Controller { @@ -86,30 +85,4 @@ class SettingsController extends Controller return redirect()->route('admin.settings.index')->with('success', 'Invoice settings updated!'); } - public function downloadAllInvoices() - { - $zip = new ZipArchive; - $zip_safe_path = storage_path('invoices.zip'); - $res = $zip->open($zip_safe_path, ZipArchive::CREATE | ZipArchive::OVERWRITE); - $result = $this::rglob(storage_path('app/invoice/*')); - if ($res === TRUE) { - $zip->addFromString("1. Info.txt", "This Archive contains all Invoices from all Users!\nIf there are no Invoices here, no Invoices have ever been created!"); - foreach ($result as $file) { - if (file_exists($file) && is_file($file)) { - $zip->addFile($file, basename($file)); - } - } - $zip->close(); - } - return response()->download($zip_safe_path); - } - - public function rglob($pattern, $flags = 0) - { - $files = glob($pattern, $flags); - foreach (glob(dirname($pattern) . '/*', GLOB_ONLYDIR | GLOB_NOSORT) as $dir) { - $files = array_merge($files, $this::rglob($dir . '/' . basename($pattern), $flags)); - } - return $files; - } } diff --git a/resources/views/admin/payments/index.blade.php b/resources/views/admin/payments/index.blade.php index f37485ea..de1fc9c1 100644 --- a/resources/views/admin/payments/index.blade.php +++ b/resources/views/admin/payments/index.blade.php @@ -27,6 +27,10 @@
{{ __('Payments') }}
+
@@ -43,6 +47,7 @@ {{ __('Payment ID') }} {{ __('Payment Method') }} {{ __('Created at') }} + @@ -78,6 +83,7 @@ {data: 'payment_id'}, {data: 'payment_method'}, {data: 'created_at'}, + {data: 'actions' , sortable : false}, ], fnDrawCallback: function(oSettings) { $('[data-toggle="popover"]').popover(); diff --git a/resources/views/admin/settings/tabs/invoice.blade.php b/resources/views/admin/settings/tabs/invoice.blade.php index df6469e0..e4e31880 100644 --- a/resources/views/admin/settings/tabs/invoice.blade.php +++ b/resources/views/admin/settings/tabs/invoice.blade.php @@ -1,10 +1,6 @@ @inject('Invoices', 'App\Classes\Settings\InvoiceSettingsC')
-
@csrf diff --git a/routes/web.php b/routes/web.php index e648508f..c39ec7f8 100644 --- a/routes/web.php +++ b/routes/web.php @@ -3,6 +3,7 @@ use App\Http\Controllers\Admin\ActivityLogController; use App\Http\Controllers\Admin\ApplicationApiController; use App\Http\Controllers\Admin\ConfigurationController; +use App\Http\Controllers\Admin\InvoiceController; use App\Http\Controllers\Admin\OverViewController; use App\Http\Controllers\Admin\PaymentController; use App\Http\Controllers\Admin\CreditProductController; @@ -132,9 +133,12 @@ Route::middleware(['auth', 'checkSuspended'])->group(function () { #settings Route::patch('settings/update/icons', [SettingsController::class, 'updateIcons'])->name('settings.update.icons'); Route::patch('settings/update/invoice-settings', [SettingsController::class, 'updateInvoiceSettings'])->name('settings.update.invoicesettings'); - Route::get('settings/download-invoices', [SettingsController::class, 'downloadAllInvoices'])->name('settings.downloadAllInvoices');; Route::resource('settings', SettingsController::class)->only('index'); + #invoices + Route::get('invoices/download-invoices', [InvoiceController::class, 'downloadAllInvoices'])->name('invoices.downloadAllInvoices');; + Route::get('invoices/download-single-invoice', [InvoiceController::class, 'downloadSingleInvoice'])->name('invoices.downloadSingleInvoice');; + #usefullinks Route::get('usefullinks/datatable', [UsefulLinkController::class, 'datatable'])->name('usefullinks.datatable'); Route::resource('usefullinks', UsefulLinkController::class); From c2988787e6f87dc648f28f5be443749b22a0b91b Mon Sep 17 00:00:00 2001 From: 1Day Date: Tue, 4 Jan 2022 09:33:38 +0100 Subject: [PATCH 09/60] Invoice Settings looks nicer --- resources/views/admin/settings/tabs/invoice.blade.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/resources/views/admin/settings/tabs/invoice.blade.php b/resources/views/admin/settings/tabs/invoice.blade.php index e4e31880..e6086091 100644 --- a/resources/views/admin/settings/tabs/invoice.blade.php +++ b/resources/views/admin/settings/tabs/invoice.blade.php @@ -7,7 +7,7 @@ @method('PATCH')
-
+
@@ -45,7 +45,8 @@ class="form-control @error('company-vat') is-invalid @enderror">
- +
+
@@ -92,8 +93,12 @@ @enderror
+
+ + +
From 6f1d372512eab31fc5e73094bddcca9ba4615d4b Mon Sep 17 00:00:00 2001 From: 1Day Date: Tue, 4 Jan 2022 10:03:03 +0100 Subject: [PATCH 10/60] basics for the language-settings --- .../SettingsController.php | 7 +- .../admin/settings/tabs/invoice.blade.php | 1 + .../admin/settings/tabs/language.blade.php | 66 +++++++++++++++++++ resources/views/layouts/main.blade.php | 2 +- routes/web.php | 1 + 5 files changed, 75 insertions(+), 2 deletions(-) create mode 100644 resources/views/admin/settings/tabs/language.blade.php diff --git a/app/Http/Controllers/Admin/SettingsControllers/SettingsController.php b/app/Http/Controllers/Admin/SettingsControllers/SettingsController.php index cfc7a531..72b441f4 100644 --- a/app/Http/Controllers/Admin/SettingsControllers/SettingsController.php +++ b/app/Http/Controllers/Admin/SettingsControllers/SettingsController.php @@ -38,7 +38,7 @@ class SettingsController extends Controller return view('admin.settings.index', [ 'tabs' => $tabs, 'tabListItems' => $tabListItems, - ]);; + ]); } public function updateIcons(Request $request) @@ -85,4 +85,9 @@ class SettingsController extends Controller return redirect()->route('admin.settings.index')->with('success', 'Invoice settings updated!'); } + public function updateLanguageSettings (Request $request){ + + + } + } diff --git a/resources/views/admin/settings/tabs/invoice.blade.php b/resources/views/admin/settings/tabs/invoice.blade.php index e6086091..eb9cdbf7 100644 --- a/resources/views/admin/settings/tabs/invoice.blade.php +++ b/resources/views/admin/settings/tabs/invoice.blade.php @@ -102,3 +102,4 @@
+ diff --git a/resources/views/admin/settings/tabs/language.blade.php b/resources/views/admin/settings/tabs/language.blade.php new file mode 100644 index 00000000..d2f8c6f5 --- /dev/null +++ b/resources/views/admin/settings/tabs/language.blade.php @@ -0,0 +1,66 @@ +
+
+ @csrf + @method('PATCH') + +
+
+
+ + + + + + + +
+ +
+ + + +
+ + + +
+
+
+ + +
+ + +
+ + diff --git a/resources/views/layouts/main.blade.php b/resources/views/layouts/main.blade.php index 6e34d263..97beb77b 100644 --- a/resources/views/layouts/main.blade.php +++ b/resources/views/layouts/main.blade.php @@ -57,7 +57,7 @@
- - + +
- +
From 63888f11e5ce90b35b2a12befe06d2a207bdf2e8 Mon Sep 17 00:00:00 2001 From: 1Day Date: Wed, 5 Jan 2022 08:57:41 +0100 Subject: [PATCH 13/60] ability to slam all settings into one database --- app/Classes/Pterodactyl.php | 4 +- .../Admin/ConfigurationController.php | 54 ---------------- .../Controllers/Admin/PaymentController.php | 20 +++--- .../Controllers/Admin/ProductController.php | 7 +- .../SettingsController.php | 41 ++++++++++++ app/Http/Controllers/Api/UserController.php | 6 +- .../Controllers/Auth/RegisterController.php | 8 +-- .../Controllers/Auth/SocialiteController.php | 6 +- app/Http/Controllers/HomeController.php | 3 - app/Http/Controllers/ProfileController.php | 11 ++-- app/Http/Controllers/ServerController.php | 10 +-- app/Http/Controllers/StoreController.php | 6 +- app/Http/Middleware/GlobalNames.php | 3 +- app/Listeners/UnsuspendServers.php | 5 +- app/Listeners/Verified.php | 8 +-- app/Models/CreditProduct.php | 2 +- .../{Configuration.php => Settings.php} | 12 ++-- .../ServersSuspendedNotification.php | 1 - app/Notifications/WelcomeMessage.php | 18 +++--- ...ble.php => 2022_01_05_071039_settings.php} | 13 ++-- database/seeders/DatabaseSeeder.php | 4 +- ...igurationSeeder.php => SettingsSeeder.php} | 64 +++++++++---------- .../settings/tabs/configurations.blade.php | 4 +- routes/web.php | 7 +- 24 files changed, 146 insertions(+), 171 deletions(-) delete mode 100644 app/Http/Controllers/Admin/ConfigurationController.php rename app/Models/{Configuration.php => Settings.php} (69%) rename database/migrations/{2021_05_08_164658_create_configurations_table.php => 2022_01_05_071039_settings.php} (57%) rename database/seeders/Seeds/{ConfigurationSeeder.php => SettingsSeeder.php} (70%) diff --git a/app/Classes/Pterodactyl.php b/app/Classes/Pterodactyl.php index 20caa00a..1e5bd646 100644 --- a/app/Classes/Pterodactyl.php +++ b/app/Classes/Pterodactyl.php @@ -2,11 +2,11 @@ namespace App\Classes; -use App\Models\Configuration; use App\Models\Egg; use App\Models\Nest; use App\Models\Node; use App\Models\Server; +use App\Models\Settings; use Exception; use Illuminate\Http\Client\PendingRequest; use Illuminate\Http\Client\Response; @@ -141,7 +141,7 @@ class Pterodactyl */ public static function getAllocations(Node $node) { - $per_page = Configuration::getValueByKey('ALLOCATION_LIMIT', 200); + $per_page = Settings::getValueByKey('SETTINGS::SERVER:ALLOCATION_LIMIT', 200); try { $response = self::client()->get("/application/nodes/{$node->id}/allocations?per_page={$per_page}"); } catch (Exception $e) { diff --git a/app/Http/Controllers/Admin/ConfigurationController.php b/app/Http/Controllers/Admin/ConfigurationController.php deleted file mode 100644 index 1be4bafe..00000000 --- a/app/Http/Controllers/Admin/ConfigurationController.php +++ /dev/null @@ -1,54 +0,0 @@ -input('key')); - - $request->validate([ - 'key' => 'required|string|max:191', - 'value' => 'required|string|max:191', - ]); - - $configuration->update($request->all()); - - return redirect()->route('admin.settings.index')->with('success', __('configuration has been updated!')); - } - - /** - * Remove the specified resource from storage. - * - * @param Configuration $configuration - * @return Response - */ - public function destroy(Configuration $configuration) - { - // - } - - public function datatable() - { - $query = Configuration::query(); - - return datatables($query) - ->addColumn('actions', function (Configuration $configuration) { - return ' '; - }) - ->editColumn('created_at', function (Configuration $configuration) { - return $configuration->created_at ? $configuration->created_at->diffForHumans() : ''; - }) - ->rawColumns(['actions']) - ->make(); - } -} diff --git a/app/Http/Controllers/Admin/PaymentController.php b/app/Http/Controllers/Admin/PaymentController.php index ff882da6..a08dddc7 100644 --- a/app/Http/Controllers/Admin/PaymentController.php +++ b/app/Http/Controllers/Admin/PaymentController.php @@ -4,10 +4,10 @@ namespace App\Http\Controllers\Admin; use App\Events\UserUpdateCreditsEvent; use App\Http\Controllers\Controller; -use App\Models\Configuration; use App\Models\InvoiceSettings; use App\Models\Payment; use App\Models\CreditProduct; +use App\Models\Settings; use App\Models\User; use App\Notifications\InvoiceNotification; use App\Notifications\ConfirmPaymentNotification; @@ -167,9 +167,9 @@ class PaymentController extends Controller $user->increment('credits', $creditProduct->quantity); //update server limit - if (Configuration::getValueByKey('SERVER_LIMIT_AFTER_IRL_PURCHASE') !== 0) { - if ($user->server_limit < Configuration::getValueByKey('SERVER_LIMIT_AFTER_IRL_PURCHASE')) { - $user->update(['server_limit' => Configuration::getValueByKey('SERVER_LIMIT_AFTER_IRL_PURCHASE')]); + if (Settings::getValueByKey('SETTINGS::USER:SERVER_LIMIT_AFTER_IRL_PURCHASE') !== 0) { + if ($user->server_limit < Settings::getValueByKey('SETTINGS::USER:SERVER_LIMIT_AFTER_IRL_PURCHASE')) { + $user->update(['server_limit' => Settings::getValueByKey('SETTINGS::USER:SERVER_LIMIT_AFTER_IRL_PURCHASE')]); } } @@ -304,9 +304,9 @@ class PaymentController extends Controller $user->increment('credits', $creditProduct->quantity); //update server limit - if (Configuration::getValueByKey('SERVER_LIMIT_AFTER_IRL_PURCHASE') !== 0) { - if ($user->server_limit < Configuration::getValueByKey('SERVER_LIMIT_AFTER_IRL_PURCHASE')) { - $user->update(['server_limit' => Configuration::getValueByKey('SERVER_LIMIT_AFTER_IRL_PURCHASE')]); + if (Settings::getValueByKey('SETTINGS::USER:SERVER_LIMIT_AFTER_IRL_PURCHASE') !== 0) { + if ($user->server_limit < Settings::getValueByKey('SETTINGS::USER:SERVER_LIMIT_AFTER_IRL_PURCHASE')) { + $user->update(['server_limit' => Settings::getValueByKey('SETTINGS::USER:SERVER_LIMIT_AFTER_IRL_PURCHASE')]); } } @@ -398,9 +398,9 @@ class PaymentController extends Controller $user->increment('credits', $payment->amount); //update server limit - if (Configuration::getValueByKey('SERVER_LIMIT_AFTER_IRL_PURCHASE') !== 0) { - if ($user->server_limit < Configuration::getValueByKey('SERVER_LIMIT_AFTER_IRL_PURCHASE')) { - $user->update(['server_limit' => Configuration::getValueByKey('SERVER_LIMIT_AFTER_IRL_PURCHASE')]); + if (Settings::getValueByKey('SETTINGS::USER:SERVER_LIMIT_AFTER_IRL_PURCHASE') !== 0) { + if ($user->server_limit < Settings::getValueByKey('SETTINGS::USER:SERVER_LIMIT_AFTER_IRL_PURCHASE')) { + $user->update(['server_limit' => Settings::getValueByKey('SETTINGS::USER:SERVER_LIMIT_AFTER_IRL_PURCHASE')]); } } diff --git a/app/Http/Controllers/Admin/ProductController.php b/app/Http/Controllers/Admin/ProductController.php index bf32069f..6386fe0a 100644 --- a/app/Http/Controllers/Admin/ProductController.php +++ b/app/Http/Controllers/Admin/ProductController.php @@ -3,12 +3,10 @@ namespace App\Http\Controllers\Admin; use App\Http\Controllers\Controller; -use App\Models\Egg; use App\Models\Location; use App\Models\Nest; -use App\Models\Node; -use App\Models\Configuration; use App\Models\Product; +use App\Models\Settings; use Exception; use Illuminate\Contracts\Foundation\Application; use Illuminate\Contracts\View\Factory; @@ -16,7 +14,6 @@ use Illuminate\Contracts\View\View; use Illuminate\Http\JsonResponse; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; -use Illuminate\Http\Response; class ProductController extends Controller { @@ -97,7 +94,7 @@ class ProductController extends Controller { return view('admin.products.show', [ 'product' => $product, - 'minimum_credits' => Configuration::getValueByKey("MINIMUM_REQUIRED_CREDITS_TO_MAKE_SERVER"), + 'minimum_credits' => Settings::getValueByKey("SETTINGS::USER:MINIMUM_REQUIRED_CREDITS_TO_MAKE_SERVER"), ]); } diff --git a/app/Http/Controllers/Admin/SettingsControllers/SettingsController.php b/app/Http/Controllers/Admin/SettingsControllers/SettingsController.php index a4b2edc6..e5107e66 100644 --- a/app/Http/Controllers/Admin/SettingsControllers/SettingsController.php +++ b/app/Http/Controllers/Admin/SettingsControllers/SettingsController.php @@ -4,6 +4,7 @@ namespace App\Http\Controllers\Admin\SettingsControllers; use App\Http\Controllers\Controller; use App\Models\InvoiceSettings; +use App\Models\Settings; use Illuminate\Contracts\Foundation\Application; use Illuminate\Contracts\View\Factory; use Illuminate\Contracts\View\View; @@ -85,4 +86,44 @@ class SettingsController extends Controller return redirect()->route('admin.settings.index')->with('success', 'Invoice settings updated!'); } + public function updatevalue(Request $request) + { + $setting = Settings::findOrFail($request->input('key')); + + $request->validate([ + 'key' => 'required|string|max:191', + 'value' => 'required|string|max:191', + ]); + + $setting->update($request->all()); + + return redirect()->route('admin.settings.index')->with('success', __('configuration has been updated!')); + } + + /** + * Remove the specified resource from storage. + * + * @param Settings $setting + * @return Response + */ + public function destroy(Settings $setting) + { + // + } + + public function datatable() + { + $query = Settings::query(); + + return datatables($query) + ->addColumn('actions', function (Settings $setting) { + return ' '; + }) + ->editColumn('created_at', function (Settings $setting) { + return $setting->created_at ? $setting->created_at->diffForHumans() : ''; + }) + ->rawColumns(['actions']) + ->make(); + } + } diff --git a/app/Http/Controllers/Api/UserController.php b/app/Http/Controllers/Api/UserController.php index ff12d850..68757c00 100644 --- a/app/Http/Controllers/Api/UserController.php +++ b/app/Http/Controllers/Api/UserController.php @@ -5,8 +5,8 @@ namespace App\Http\Controllers\Api; use App\Classes\Pterodactyl; use App\Events\UserUpdateCreditsEvent; use App\Http\Controllers\Controller; -use App\Models\Configuration; use App\Models\DiscordUser; +use App\Models\Settings; use App\Models\User; use Illuminate\Contracts\Foundation\Application; use Illuminate\Contracts\Pagination\LengthAwarePaginator; @@ -180,8 +180,8 @@ class UserController extends Controller $user = User::create([ 'name' => $request->input('name'), 'email' => $request->input('email'), - 'credits' => Configuration::getValueByKey('INITIAL_CREDITS', 150), - 'server_limit' => Configuration::getValueByKey('INITIAL_SERVER_LIMIT', 1), + 'credits' => Settings::getValueByKey('SETTINGS::USER:INITIAL_CREDITS', 150), + 'server_limit' => Settings::getValueByKey('SETTINGS::USER:INITIAL_SERVER_LIMIT', 1), 'password' => Hash::make($request->input('password')), ]); diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index 4073adef..813e7b02 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -4,7 +4,7 @@ namespace App\Http\Controllers\Auth; use App\Classes\Pterodactyl; use App\Http\Controllers\Controller; -use App\Models\Configuration; +use App\Models\Settings; use App\Models\User; use App\Providers\RouteServiceProvider; use Illuminate\Foundation\Auth\RegistersUsers; @@ -53,7 +53,7 @@ class RegisterController extends Controller */ protected function validator(array $data) { - if (Configuration::getValueByKey('REGISTER_IP_CHECK', 'true') == 'true') { + if (Settings::getValueByKey('SETTINGS::SYSTEM:REGISTER_IP_CHECK', 'true') == 'true') { //check if ip has already made an account $data['ip'] = session()->get('ip') ?? request()->ip(); @@ -90,8 +90,8 @@ class RegisterController extends Controller $user = User::create([ 'name' => $data['name'], 'email' => $data['email'], - 'credits' => Configuration::getValueByKey('INITIAL_CREDITS', 150), - 'server_limit' => Configuration::getValueByKey('INITIAL_SERVER_LIMIT', 1), + 'credits' => Settings::getValueByKey('SETTINGS::USER:INITIAL_CREDITS', 150), + 'server_limit' => Settings::getValueByKey('SETTINGS::USER:INITIAL_SERVER_LIMIT', 1), 'password' => Hash::make($data['password']), ]); diff --git a/app/Http/Controllers/Auth/SocialiteController.php b/app/Http/Controllers/Auth/SocialiteController.php index aa8b93c2..08310231 100644 --- a/app/Http/Controllers/Auth/SocialiteController.php +++ b/app/Http/Controllers/Auth/SocialiteController.php @@ -3,8 +3,8 @@ namespace App\Http\Controllers\Auth; use App\Http\Controllers\Controller; -use App\Models\Configuration; use App\Models\DiscordUser; +use App\Models\Settings; use App\Models\User; use App\Models\Voucher; use Illuminate\Support\Facades\Auth; @@ -40,8 +40,8 @@ class SocialiteController extends Controller //create discord user in db DiscordUser::create(array_merge($discord->user, ['user_id' => Auth::user()->id])); //update user - Auth::user()->increment('credits', Configuration::getValueByKey('CREDITS_REWARD_AFTER_VERIFY_DISCORD')); - Auth::user()->increment('server_limit', Configuration::getValueByKey('SERVER_LIMIT_REWARD_AFTER_VERIFY_DISCORD')); + Auth::user()->increment('credits', Settings::getValueByKey('SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_DISCORD')); + Auth::user()->increment('server_limit', Settings::getValueByKey('SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_DISCORD')); Auth::user()->update(['discord_verified_at' => now()]); } else { $user->discordUser->update($discord->user); diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 646293ac..d6b2fd18 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -2,10 +2,7 @@ namespace App\Http\Controllers; -use App\Models\Egg; -use App\Models\Product; use App\Models\UsefulLink; -use App\Models\Configuration; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php index 3ddc1655..f8ac085a 100644 --- a/app/Http/Controllers/ProfileController.php +++ b/app/Http/Controllers/ProfileController.php @@ -2,13 +2,10 @@ namespace App\Http\Controllers; -use App\Models\Configuration; +use App\Models\Settings; use App\Models\User; -use Illuminate\Contracts\View\Factory; -use Illuminate\Contracts\View\View; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; -use Illuminate\Http\Response; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Hash; @@ -19,9 +16,9 @@ class ProfileController extends Controller { return view('profile.index')->with([ 'user' => Auth::user(), - 'credits_reward_after_verify_discord' => Configuration::getValueByKey('CREDITS_REWARD_AFTER_VERIFY_DISCORD'), - 'force_email_verification' => Configuration::getValueByKey('FORCE_EMAIL_VERIFICATION'), - 'force_discord_verification' => Configuration::getValueByKey('FORCE_DISCORD_VERIFICATION'), + 'credits_reward_after_verify_discord' => Settings::getValueByKey('SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_DISCORD'), + 'force_email_verification' => Settings::getValueByKey('SETTINGS::USER:FORCE_EMAIL_VERIFICATION'), + 'force_discord_verification' => Settings::getValueByKey('SETTINGS::USER:FORCE_DISCORD_VERIFICATION'), ]); } diff --git a/app/Http/Controllers/ServerController.php b/app/Http/Controllers/ServerController.php index ff096502..61aab37f 100644 --- a/app/Http/Controllers/ServerController.php +++ b/app/Http/Controllers/ServerController.php @@ -3,13 +3,13 @@ namespace App\Http\Controllers; use App\Classes\Pterodactyl; -use App\Models\Configuration; use App\Models\Egg; use App\Models\Location; use App\Models\Nest; use App\Models\Node; use App\Models\Product; use App\Models\Server; +use App\Models\Settings; use App\Notifications\ServerCreationError; use Exception; use Illuminate\Database\Eloquent\Builder; @@ -107,7 +107,7 @@ class ServerController extends Controller if ( Auth::user()->credits < ($product->minimum_credits == -1 - ? Configuration::getValueByKey('MINIMUM_REQUIRED_CREDITS_TO_MAKE_SERVER', 50) + ? Settings::getValueByKey('SETTINGS::USER:MINIMUM_REQUIRED_CREDITS_TO_MAKE_SERVER', 50) : $product->minimum_credits) ) { return redirect()->route('servers.index')->with('error', "You do not have the required amount of " . CREDITS_DISPLAY_NAME . " to use this product!"); @@ -115,12 +115,12 @@ class ServerController extends Controller } //Required Verification for creating an server - if (Configuration::getValueByKey('FORCE_EMAIL_VERIFICATION', 'false') === 'true' && !Auth::user()->hasVerifiedEmail()) { + if (Settings::getValueByKey('SETTINGS::USER:FORCE_EMAIL_VERIFICATION', 'false') === 'true' && !Auth::user()->hasVerifiedEmail()) { return redirect()->route('profile.index')->with('error', __("You are required to verify your email address before you can create a server.")); } //Required Verification for creating an server - if (Configuration::getValueByKey('FORCE_DISCORD_VERIFICATION', 'false') === 'true' && !Auth::user()->discordUser) { + if (Settings::getValueByKey('SETTINGS::USER:FORCE_DISCORD_VERIFICATION', 'false') === 'true' && !Auth::user()->discordUser) { return redirect()->route('profile.index')->with('error', __("You are required to link your discord account before you can create a server.")); } @@ -168,7 +168,7 @@ class ServerController extends Controller 'identifier' => $serverAttributes['identifier'] ]); - if (Configuration::getValueByKey('SERVER_CREATE_CHARGE_FIRST_HOUR', 'true') == 'true') { + if (Settings::getValueByKey('SETTINGS::SYSTEM:SERVER_CREATE_CHARGE_FIRST_HOUR', 'true') == 'true') { if ($request->user()->credits >= $server->product->getHourlyPrice()) { $request->user()->decrement('credits', $server->product->getHourlyPrice()); } diff --git a/app/Http/Controllers/StoreController.php b/app/Http/Controllers/StoreController.php index c2ce00e8..eac70f98 100644 --- a/app/Http/Controllers/StoreController.php +++ b/app/Http/Controllers/StoreController.php @@ -2,8 +2,8 @@ namespace App\Http\Controllers; -use App\Models\Configuration; use App\Models\CreditProduct; +use App\Models\Settings; use Illuminate\Support\Facades\Auth; class StoreController extends Controller @@ -20,12 +20,12 @@ class StoreController extends Controller ) $isPaymentSetup = true; //Required Verification for creating an server - if (Configuration::getValueByKey('FORCE_EMAIL_VERIFICATION', false) === 'true' && !Auth::user()->hasVerifiedEmail()) { + if (Settings::getValueByKey('SETTINGS::USER:FORCE_EMAIL_VERIFICATION', false) === 'true' && !Auth::user()->hasVerifiedEmail()) { return redirect()->route('profile.index')->with('error', __("You are required to verify your email address before you can purchase credits.")); } //Required Verification for creating an server - if (Configuration::getValueByKey('FORCE_DISCORD_VERIFICATION', false) === 'true' && !Auth::user()->discordUser) { + if (Settings::getValueByKey('SETTINGS::USER:FORCE_DISCORD_VERIFICATION', false) === 'true' && !Auth::user()->discordUser) { return redirect()->route('profile.index')->with('error', __("You are required to link your discord account before you can purchase Credits")); } diff --git a/app/Http/Middleware/GlobalNames.php b/app/Http/Middleware/GlobalNames.php index 519b111d..24d77c27 100644 --- a/app/Http/Middleware/GlobalNames.php +++ b/app/Http/Middleware/GlobalNames.php @@ -3,6 +3,7 @@ namespace App\Http\Middleware; use App\Models\Configuration; +use App\Models\Settings; use Closure; use Illuminate\Http\Request; @@ -17,7 +18,7 @@ class GlobalNames */ public function handle(Request $request, Closure $next) { - define('CREDITS_DISPLAY_NAME' , Configuration::getValueByKey('CREDITS_DISPLAY_NAME' , 'Credits')); + define('CREDITS_DISPLAY_NAME' , Settings::getValueByKey('SETTINGS::SYSTEM:CREDITS_DISPLAY_NAME' , 'Credits')); $unsupported_lang_array = explode(',', config("app.unsupported_locales")); $unsupported_lang_array = array_map( 'strtolower', $unsupported_lang_array ); diff --git a/app/Listeners/UnsuspendServers.php b/app/Listeners/UnsuspendServers.php index 51f1ad60..5d8ce069 100644 --- a/app/Listeners/UnsuspendServers.php +++ b/app/Listeners/UnsuspendServers.php @@ -3,11 +3,10 @@ namespace App\Listeners; use App\Events\UserUpdateCreditsEvent; -use App\Models\Configuration; use App\Models\Server; +use App\Models\Settings; use Exception; use Illuminate\Contracts\Queue\ShouldQueue; -use Illuminate\Queue\InteractsWithQueue; class UnsuspendServers implements ShouldQueue { @@ -20,7 +19,7 @@ class UnsuspendServers implements ShouldQueue */ public function handle(UserUpdateCreditsEvent $event) { - if ($event->user->credits > Configuration::getValueByKey('MINIMUM_REQUIRED_CREDITS_TO_MAKE_SERVER' , 50)){ + if ($event->user->credits > Settings::getValueByKey('SETTINGS::USER:MINIMUM_REQUIRED_CREDITS_TO_MAKE_SERVER' , 50)){ /** @var Server $server */ foreach ($event->user->servers as $server){ if ($server->isSuspended()) $server->unSuspend(); diff --git a/app/Listeners/Verified.php b/app/Listeners/Verified.php index b87ff058..875bd4c0 100644 --- a/app/Listeners/Verified.php +++ b/app/Listeners/Verified.php @@ -2,9 +2,7 @@ namespace App\Listeners; -use App\Models\Configuration; -use Illuminate\Contracts\Queue\ShouldQueue; -use Illuminate\Queue\InteractsWithQueue; +use App\Models\Settings; class Verified { @@ -26,7 +24,7 @@ class Verified */ public function handle($event) { - $event->user->increment('server_limit' , Configuration::getValueByKey('SERVER_LIMIT_REWARD_AFTER_VERIFY_EMAIL')); - $event->user->increment('credits' , Configuration::getValueByKey('CREDITS_REWARD_AFTER_VERIFY_EMAIL')); + $event->user->increment('server_limit' , Settings::getValueByKey('SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_EMAIL')); + $event->user->increment('credits' , Settings::getValueByKey('SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_EMAIL')); } } diff --git a/app/Models/CreditProduct.php b/app/Models/CreditProduct.php index 1effeb6f..5fa07b59 100644 --- a/app/Models/CreditProduct.php +++ b/app/Models/CreditProduct.php @@ -59,7 +59,7 @@ class CreditProduct extends Model */ public function getTaxPercent() { - $tax = Configuration::getValueByKey("SALES_TAX"); + $tax = Settings::getValueByKey("SETTINGS::PAYMENTS:SALES_TAX"); return $tax < 0 ? 0 : $tax; } diff --git a/app/Models/Configuration.php b/app/Models/Settings.php similarity index 69% rename from app/Models/Configuration.php rename to app/Models/Settings.php index a07846f2..d0f97cc8 100644 --- a/app/Models/Configuration.php +++ b/app/Models/Settings.php @@ -6,11 +6,11 @@ use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Facades\Cache; -class Configuration extends Model +class Settings extends Model { use HasFactory; - public const CACHE_TAG = 'configuration'; + public const CACHE_TAG = 'setting'; public $primaryKey = 'key'; @@ -28,8 +28,8 @@ class Configuration extends Model { parent::boot(); - static::updated(function (Configuration $configuration) { - Cache::forget(self::CACHE_TAG .':'. $configuration->key); + static::updated(function (Settings $settings) { + Cache::forget(self::CACHE_TAG .':'. $settings->key); }); } @@ -41,8 +41,8 @@ class Configuration extends Model public static function getValueByKey(string $key, $default = null) { return Cache::rememberForever(self::CACHE_TAG .':'. $key, function () use ($default, $key) { - $configuration = self::find($key); - return $configuration ? $configuration->value : $default; + $settings = self::find($key); + return $settings ? $settings->value : $default; }); } } diff --git a/app/Notifications/ServersSuspendedNotification.php b/app/Notifications/ServersSuspendedNotification.php index c73f8c0d..c6ed279b 100644 --- a/app/Notifications/ServersSuspendedNotification.php +++ b/app/Notifications/ServersSuspendedNotification.php @@ -2,7 +2,6 @@ namespace App\Notifications; -use App\Models\Configuration; use Illuminate\Bus\Queueable; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Notifications\Messages\MailMessage; diff --git a/app/Notifications/WelcomeMessage.php b/app/Notifications/WelcomeMessage.php index 3c730486..d68a517b 100644 --- a/app/Notifications/WelcomeMessage.php +++ b/app/Notifications/WelcomeMessage.php @@ -2,7 +2,7 @@ namespace App\Notifications; -use App\Models\Configuration; +use App\Models\Settings; use App\Models\User; use Illuminate\Bus\Queueable; use Illuminate\Contracts\Queue\ShouldQueue; @@ -41,18 +41,18 @@ class WelcomeMessage extends Notification implements ShouldQueue { $AdditionalLine = ""; - if(Configuration::getValueByKey('CREDITS_REWARD_AFTER_VERIFY_EMAIL') != 0) { - $AdditionalLine .= "Verifying your e-mail address will grant you ".Configuration::getValueByKey('CREDITS_REWARD_AFTER_VERIFY_EMAIL')." additional " . Configuration::getValueByKey('CREDITS_DISPLAY_NAME') . ".
"; + if(Settings::getValueByKey('SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_EMAIL') != 0) { + $AdditionalLine .= "Verifying your e-mail address will grant you ".Settings::getValueByKey('SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_EMAIL')." additional " . Settings::getValueByKey('SETTINGS::SYSTEM:CREDITS_DISPLAY_NAME') . ".
"; } - if(Configuration::getValueByKey('SERVER_LIMIT_REWARD_AFTER_VERIFY_EMAIL') != 0) { - $AdditionalLine .= "Verifying your e-mail will also increase your Server Limit by " . Configuration::getValueByKey('SERVER_LIMIT_REWARD_AFTER_VERIFY_EMAIL') . ".
"; + if(Settings::getValueByKey('SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_EMAIL') != 0) { + $AdditionalLine .= "Verifying your e-mail will also increase your Server Limit by " . Settings::getValueByKey('SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_EMAIL') . ".
"; } $AdditionalLine .="
"; - if(Configuration::getValueByKey('CREDITS_REWARD_AFTER_VERIFY_DISCORD') != 0) { - $AdditionalLine .= "You can also verify your discord account to get another " . Configuration::getValueByKey('CREDITS_REWARD_AFTER_VERIFY_DISCORD') . " " . Configuration::getValueByKey('CREDITS_DISPLAY_NAME') . ".
"; + if(Settings::getValueByKey('SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_DISCORD') != 0) { + $AdditionalLine .= "You can also verify your discord account to get another " . Settings::getValueByKey('SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_DISCORD') . " " . Settings::getValueByKey('SETTINGS::SYSTEM:CREDITS_DISPLAY_NAME') . ".
"; } - if(Configuration::getValueByKey('SERVER_LIMIT_REWARD_AFTER_VERIFY_DISCORD') != 0) { - $AdditionalLine .= "Verifying your Discord account will also increase your Server Limit by " . Configuration::getValueByKey('SERVER_LIMIT_REWARD_AFTER_VERIFY_DISCORD') . ".
"; + if(Settings::getValueByKey('SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_DISCORD') != 0) { + $AdditionalLine .= "Verifying your Discord account will also increase your Server Limit by " . Settings::getValueByKey('SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_DISCORD') . ".
"; } return $AdditionalLine; diff --git a/database/migrations/2021_05_08_164658_create_configurations_table.php b/database/migrations/2022_01_05_071039_settings.php similarity index 57% rename from database/migrations/2021_05_08_164658_create_configurations_table.php rename to database/migrations/2022_01_05_071039_settings.php index f353c4aa..d7c0a52a 100644 --- a/database/migrations/2021_05_08_164658_create_configurations_table.php +++ b/database/migrations/2022_01_05_071039_settings.php @@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -class CreateConfigurationsTable extends Migration +class Settings extends Migration { /** * Run the migrations. @@ -13,11 +13,12 @@ class CreateConfigurationsTable extends Migration */ public function up() { - Schema::create('configurations', function (Blueprint $table) { - $table->string('key')->primary(); + Schema::create('settings', function (Blueprint $table) { + $table->id(); + $table->string('key'); $table->string('value'); - $table->string('type')->default('string'); - $table->text('description')->nullable(); + $table->string('type'); + $table->string('description'); $table->timestamps(); }); } @@ -29,6 +30,6 @@ class CreateConfigurationsTable extends Migration */ public function down() { - Schema::dropIfExists('configurations'); + Schema::dropIfExists('settings'); } } diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index f275ede7..25db0f88 100644 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -2,7 +2,7 @@ namespace Database\Seeders; -use Database\Seeders\Seeds\ConfigurationSeeder; +use Database\Seeders\Seeds\SettingsSeeder; use Database\Seeders\Seeds\InvoiceSettingsSeeder; use Illuminate\Database\Seeder; @@ -16,7 +16,7 @@ class DatabaseSeeder extends Seeder public function run() { $this->call([ - ConfigurationSeeder::class, + SettingsSeeder::class, ]); } diff --git a/database/seeders/Seeds/ConfigurationSeeder.php b/database/seeders/Seeds/SettingsSeeder.php similarity index 70% rename from database/seeders/Seeds/ConfigurationSeeder.php rename to database/seeders/Seeds/SettingsSeeder.php index 98d3a57a..6e57b1fc 100644 --- a/database/seeders/Seeds/ConfigurationSeeder.php +++ b/database/seeders/Seeds/SettingsSeeder.php @@ -2,10 +2,10 @@ namespace Database\Seeders\Seeds; -use App\Models\Configuration; +use App\Models\Settings; use Illuminate\Database\Seeder; -class ConfigurationSeeder extends Seeder +class SettingsSeeder extends Seeder { /** * Run the database seeds. @@ -15,16 +15,16 @@ class ConfigurationSeeder extends Seeder public function run() { //initials - Configuration::firstOrCreate([ - 'key' => 'INITIAL_CREDITS', + Settings::firstOrCreate([ + 'key' => 'SETTINGS::USER:INITIAL_CREDITS', ], [ 'value' => '250', 'type' => 'integer', 'description' => 'The initial amount of credits the user starts with.' ]); - Configuration::firstOrCreate([ - 'key' => 'INITIAL_SERVER_LIMIT', + Settings::firstOrCreate([ + 'key' => 'SETTINGS::USER:NITIAL_SERVER_LIMIT', ], [ 'value' => '1', 'type' => 'integer', @@ -32,16 +32,16 @@ class ConfigurationSeeder extends Seeder ]); //verify email event - Configuration::firstOrCreate([ - 'key' => 'CREDITS_REWARD_AFTER_VERIFY_EMAIL', + Settings::firstOrCreate([ + 'key' => 'SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_EMAIL', ], [ 'value' => '250', 'type' => 'integer', 'description' => 'Increase in credits after the user has verified their email account.' ]); - Configuration::firstOrCreate([ - 'key' => 'SERVER_LIMIT_REWARD_AFTER_VERIFY_EMAIL', + Settings::firstOrCreate([ + 'key' => 'SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_EMAIL', ], [ 'value' => '2', 'type' => 'integer', @@ -49,16 +49,16 @@ class ConfigurationSeeder extends Seeder ]); //verify discord event - Configuration::firstOrCreate([ - 'key' => 'CREDITS_REWARD_AFTER_VERIFY_DISCORD', + Settings::firstOrCreate([ + 'key' => 'SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_DISCORD', ], [ 'value' => '375', 'type' => 'integer', 'description' => 'Increase in credits after the user has verified their discord account.' ]); - Configuration::firstOrCreate([ - 'key' => 'SERVER_LIMIT_REWARD_AFTER_VERIFY_DISCORD', + Settings::firstOrCreate([ + 'key' => 'SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_DISCORD', ], [ 'value' => '2', 'type' => 'integer', @@ -66,8 +66,8 @@ class ConfigurationSeeder extends Seeder ]); //other - Configuration::firstOrCreate([ - 'key' => 'MINIMUM_REQUIRED_CREDITS_TO_MAKE_SERVER', + Settings::firstOrCreate([ + 'key' => 'SETTINGS::USER:MINIMUM_REQUIRED_CREDITS_TO_MAKE_SERVER', ], [ 'value' => '50', 'type' => 'integer', @@ -75,8 +75,8 @@ class ConfigurationSeeder extends Seeder ]); //purchasing - Configuration::firstOrCreate([ - 'key' => 'SERVER_LIMIT_AFTER_IRL_PURCHASE', + Settings::firstOrCreate([ + 'key' => 'SETTINGS::USER:SERVER_LIMIT_AFTER_IRL_PURCHASE', ], [ 'value' => '10', 'type' => 'integer', @@ -85,16 +85,16 @@ class ConfigurationSeeder extends Seeder //force email and discord verification - Configuration::firstOrCreate([ - 'key' => 'FORCE_EMAIL_VERIFICATION', + Settings::firstOrCreate([ + 'key' => 'SETTINGS::USER:FORCE_EMAIL_VERIFICATION', ], [ 'value' => 'false', 'type' => 'boolean', 'description' => 'Force an user to verify the email adress before creating a server / buying credits.' ]); - Configuration::firstOrCreate([ - 'key' => 'FORCE_DISCORD_VERIFICATION', + Settings::firstOrCreate([ + 'key' => 'SETTINGS::USER:FORCE_DISCORD_VERIFICATION', ], [ 'value' => 'false', 'type' => 'boolean', @@ -102,8 +102,8 @@ class ConfigurationSeeder extends Seeder ]); //disable ip check on register - Configuration::firstOrCreate([ - 'key' => 'REGISTER_IP_CHECK', + Settings::firstOrCreate([ + 'key' => 'SETTINGS::SYSTEM:REGISTER_IP_CHECK', ], [ 'value' => 'true', 'type' => 'boolean', @@ -111,8 +111,8 @@ class ConfigurationSeeder extends Seeder ]); //per_page on allocations request - Configuration::firstOrCreate([ - 'key' => 'ALLOCATION_LIMIT', + Settings::firstOrCreate([ + 'key' => 'SETTINGS::SERVER:ALLOCATION_LIMIT', ], [ 'value' => '200', 'type' => 'integer', @@ -120,8 +120,8 @@ class ConfigurationSeeder extends Seeder ]); //credits display name - Configuration::firstOrCreate([ - 'key' => 'CREDITS_DISPLAY_NAME', + Settings::firstOrCreate([ + 'key' => 'SETTINGS::SYSTEM:CREDITS_DISPLAY_NAME', ], [ 'value' => 'Credits', 'type' => 'string', @@ -129,16 +129,16 @@ class ConfigurationSeeder extends Seeder ]); //credits display name - Configuration::firstOrCreate([ - 'key' => 'SERVER_CREATE_CHARGE_FIRST_HOUR', + Settings::firstOrCreate([ + 'key' => 'SETTINGS::SYSTEM:SERVER_CREATE_CHARGE_FIRST_HOUR', ], [ 'value' => 'true', 'type' => 'boolean', 'description' => 'Charges the first hour worth of credits upon creating a server.' ]); //sales tax - Configuration::firstOrCreate([ - 'key' => 'SALES_TAX', + Settings::firstOrCreate([ + 'key' => 'SETTINGS::PAYMENTS:SALES_TAX', ], [ 'value' => '0', 'type' => 'integer', diff --git a/resources/views/admin/settings/tabs/configurations.blade.php b/resources/views/admin/settings/tabs/configurations.blade.php index 526acd5d..0d7e8ccc 100644 --- a/resources/views/admin/settings/tabs/configurations.blade.php +++ b/resources/views/admin/settings/tabs/configurations.blade.php @@ -22,7 +22,7 @@ @@ -41,7 +42,7 @@
@@ -52,7 +53,7 @@
@@ -61,17 +62,17 @@
- +
-
@@ -89,7 +90,6 @@ @error('logo') - {{ $Invoices->invoiceSettings->message }} @enderror diff --git a/routes/web.php b/routes/web.php index fa2a79af..14da9680 100644 --- a/routes/web.php +++ b/routes/web.php @@ -131,7 +131,7 @@ Route::middleware(['auth', 'checkSuspended'])->group(function () { #settings Route::patch('settings/update/icons', [SettingsController::class, 'updateIcons'])->name('settings.update.icons'); - Route::patch('settings/update/invoice-settings', [SettingsController::class, 'updateInvoiceSettings'])->name('settings.update.invoicesettings'); + Route::patch('settings/update/invoice-settings', [\App\Classes\Settings\InvoiceSettingsC::class, 'updateInvoiceSettings'])->name('settings.update.invoicesettings'); Route::patch('settings/update/lagnguage', [SettingsController::class, 'updateLanguageSettings'])->name('settings.update.languagesettings'); Route::resource('settings', SettingsController::class)->only('index'); From d30f6b9f38092eccb958ae539916347ba34e378b Mon Sep 17 00:00:00 2001 From: 1Day Date: Wed, 5 Jan 2022 11:06:17 +0100 Subject: [PATCH 16/60] Update Queries --- app/Classes/Settings/InvoiceSettingsC.php | 36 +++++++++-------------- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/app/Classes/Settings/InvoiceSettingsC.php b/app/Classes/Settings/InvoiceSettingsC.php index 1f43b745..e79d51dc 100644 --- a/app/Classes/Settings/InvoiceSettingsC.php +++ b/app/Classes/Settings/InvoiceSettingsC.php @@ -4,6 +4,7 @@ namespace App\Classes\Settings; use App\Models\Settings; use Illuminate\Http\Request; +use Illuminate\Support\Facades\Cache; class InvoiceSettingsC { @@ -22,29 +23,20 @@ class InvoiceSettingsC 'logo' => 'nullable|max:10000|mimes:jpg,png,jpeg', ]); - $name = Settings::find("SETTINGS::INVOICE:COMPANY_NAME"); - $address = Settings::find("SETTINGS::INVOICE:COMPANY_ADDRESS"); - $phone = Settings::find("SETTINGS::INVOICE:COMPANY_PHONE"); - $mail = Settings::find("SETTINGS::INVOICE:COMPANY_MAIL"); - $vat = Settings::find("SETTINGS::INVOICE:COMPANY_VAT"); - $web = Settings::find("SETTINGS::INVOICE:COMPANY_WEBSITE"); - $prefix = Settings::find("SETTINGS::INVOICE:PREFIX"); + $values=[ + "SETTINGS::INVOICE:COMPANY_NAME" => "company-name", + "SETTINGS::INVOICE:COMPANY_ADDRESS" => "company-address", + "SETTINGS::INVOICE:COMPANY_PHONE" => "company-phone", + "SETTINGS::INVOICE:COMPANY_MAIL" => "company-mail", + "SETTINGS::INVOICE:COMPANY_VAT" => "company-vat", + "SETTINGS::INVOICE:COMPANY_WEBSITE" => "company-web", + "SETTINGS::INVOICE:PREFIX" => "invoice-prefix" + ]; - $name->value=$request->get('company-name'); - $address->value=$request->get('company-address'); - $phone->value=$request->get('company-phone'); - $mail->value=$request->get('company-mail'); - $vat->value=$request->get('company-vat'); - $web->value=$request->get('company-web'); - $prefix->value=$request->get('invoice-prefix'); - - $name->save(); - $address->save(); - $phone->save(); - $mail->save(); - $vat->save(); - $web->save(); - $prefix->save(); + foreach($values as $key=>$value){ + Settings::where('key', $key)->update(['value' => $request->get($value)]); + Cache::forget("setting" .':'. $key); + } if ($request->hasFile('logo')) { From e6eb7f1e1736bea1321713c50dea765ee78b4387 Mon Sep 17 00:00:00 2001 From: 1Day Date: Wed, 5 Jan 2022 11:07:10 +0100 Subject: [PATCH 17/60] Update InvoiceSettingsC.php --- app/Classes/Settings/InvoiceSettingsC.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/Classes/Settings/InvoiceSettingsC.php b/app/Classes/Settings/InvoiceSettingsC.php index e79d51dc..6f098897 100644 --- a/app/Classes/Settings/InvoiceSettingsC.php +++ b/app/Classes/Settings/InvoiceSettingsC.php @@ -24,6 +24,7 @@ class InvoiceSettingsC ]); $values=[ + //SETTINGS::VALUE => REQUEST-VALUE (coming from the html-form) "SETTINGS::INVOICE:COMPANY_NAME" => "company-name", "SETTINGS::INVOICE:COMPANY_ADDRESS" => "company-address", "SETTINGS::INVOICE:COMPANY_PHONE" => "company-phone", From 831e6a7ee13e706a749a54107516e8f0c7852b2e Mon Sep 17 00:00:00 2001 From: 1Day Date: Wed, 5 Jan 2022 13:30:05 +0100 Subject: [PATCH 18/60] Language settings. DYNAMC IS STILL MISSING --- app/Classes/Settings/LanguageSettingsC.php | 41 ++++++++++++++ app/Http/Middleware/SetLocale.php | 14 ++--- config/app.php | 54 ++----------------- database/seeders/Seeds/SettingsSeeder.php | 41 ++++++++++++++ .../admin/settings/tabs/language.blade.php | 15 +++++- resources/views/layouts/main.blade.php | 2 + routes/web.php | 2 +- 7 files changed, 108 insertions(+), 61 deletions(-) create mode 100644 app/Classes/Settings/LanguageSettingsC.php diff --git a/app/Classes/Settings/LanguageSettingsC.php b/app/Classes/Settings/LanguageSettingsC.php new file mode 100644 index 00000000..51a84300 --- /dev/null +++ b/app/Classes/Settings/LanguageSettingsC.php @@ -0,0 +1,41 @@ + REQUEST-VALUE (coming from the html-form) + "SETTINGS::LOCALE:DEFAULT" => "defaultLanguage", + "SETTINGS::LOCALE:DYNAMIC" => "autotranslate", + "SETTINGS::LOCALE:CLIENTS_CAN_CHANGE" => "canClientChangeLanguage", + "SETTINGS::LOCALE:AVAILABLE" => "languages", + "SETTINGS::LOCALE:DATATABLES" => "datatable-language" + ]; + + foreach($values as $key=>$value){ + Settings::where('key', $key)->update(['value' => $request->get($value)]); + Cache::forget("setting" .':'. $key); + } + + + return redirect()->route('admin.settings.index')->with('success', 'Language settings updated!'); + } + +} diff --git a/app/Http/Middleware/SetLocale.php b/app/Http/Middleware/SetLocale.php index c87e891d..a6937330 100644 --- a/app/Http/Middleware/SetLocale.php +++ b/app/Http/Middleware/SetLocale.php @@ -2,6 +2,7 @@ namespace App\Http\Middleware; +use App\Models\Settings; use Closure; use Illuminate\Http\Request; use Illuminate\Support\Facades\App; @@ -208,18 +209,17 @@ class SetLocale */ public function handle($request, Closure $next) { - if (Session::has('locale')) { - $locale = Session::get('locale', config('app.locale')); + $locale = Session::get('locale', Settings::getValueByKey("SETTINGS::LOCALE:DEFAULT")); } else { - if (!config('app.dynamic_locale')) { - $locale = config('app.locale'); + if (Settings::getValueByKey("SETTINGS::LOCALE:DYNAMIC") == "false") { + $locale = Settings::getValueByKey("SETTINGS::LOCALE:DEFAULT"); }else{ $locale = substr($request->server('HTTP_ACCEPT_LANGUAGE'), 0, 2); - if (!in_array($locale, config('app.available_locales')) - || in_array(strtolower($this->getLocaleCodeForDisplayLanguage($locale)), UNSUPPORTED_LANGS)) { - $locale = config('app.locale'); + if (!in_array($locale, array_flip(preg_split ("/\,/", Settings::getValueByKey("SETTINGS::LOCALE:AVAILABLE")))) + || !in_array(strtolower($this->getLocaleCodeForDisplayLanguage($locale)), array_flip(preg_split ("/\,/", Settings::getValueByKey("SETTINGS::LOCALE:AVAILABLE"))))) { + $locale = Settings::getValueByKey("SETTINGS::LOCALE:DEFAULT"); } } diff --git a/config/app.php b/config/app.php index 5ed68b37..5292fdb2 100644 --- a/config/app.php +++ b/config/app.php @@ -1,5 +1,7 @@ '0.6.2', @@ -70,16 +72,6 @@ return [ 'timezone' => env('APP_TIMEZONE', 'UTC'), - /* - |-------------------------------------------------------------------------- - | Dyamic Locales - |-------------------------------------------------------------------------- - | - | Change the Locale depending on the Users Browserlanguage - | Can either be true or false - | - */ - 'dynamic_locale' => env('DYNAMIC_LOCALE', false), /* |-------------------------------------------------------------------------- @@ -92,47 +84,7 @@ return [ | */ - 'locale' => env('LOCALE', 'en'), - - - /* - |-------------------------------------------------------------------------- - | Available Locales - |-------------------------------------------------------------------------- - | - | You should not change this - | If the dashboard is 100% translated in a certain language, it will be added here - | - */ - 'available_locales' => array('English'=>'en','German'=>'de','Italian'=>'it','Chinese'=>'zh', 'Czech'=>'cs', 'Spanish'=>'es', 'Polish'=>'pl'), - - - /* - |-------------------------------------------------------------------------- - | Unsupported Locales - |-------------------------------------------------------------------------- - | - | Locales the Owner of the Dashboard does not want to support - | - | - */ - - 'unsupported_locales' => env("UNSUPPORTED_LOCALES", ""), - - - /* - |-------------------------------------------------------------------------- - | Datatable Language Setting - |-------------------------------------------------------------------------- - | - | This is the Language-Code used on the Datatables. - | You can grab the Language-Codes from this Website - | https://datatables.net/plug-ins/i18n/ - | - */ - - 'datatable_locale' => env('DATATABLE_LOCALE', 'en-gb'), - + 'locale' =>"en", /* |-------------------------------------------------------------------------- diff --git a/database/seeders/Seeds/SettingsSeeder.php b/database/seeders/Seeds/SettingsSeeder.php index 499349f1..010e76b0 100644 --- a/database/seeders/Seeds/SettingsSeeder.php +++ b/database/seeders/Seeds/SettingsSeeder.php @@ -205,5 +205,46 @@ class SettingsSeeder extends Seeder 'type' => 'string', 'description' => 'The invoice prefix' ]); + + //Locale + Settings::firstOrCreate([ + 'key' => 'SETTINGS::LOCALE:DEFAULT', + ], [ + 'value' => 'en', + 'type' => 'string', + 'description' => 'The default Language the dashboard will be shown in' + ]); + //Dynamic locale + Settings::firstOrCreate([ + 'key' => 'SETTINGS::LOCALE:DYNAMIC', + ], [ + 'value' => 'false', + 'type' => 'boolean', + 'description' => 'If this is true, the Language will change to the Clients browserlanguage or default.' + ]); + //User can change Locale + Settings::firstOrCreate([ + 'key' => 'SETTINGS::LOCALE:CLIENTS_CAN_CHANGE', + ], [ + 'value' => 'false', + 'type' => 'boolean', + 'description' => 'If this is true, the clients will be able to change their Locale.' + ]); + //Locale + Settings::firstOrCreate([ + 'key' => 'SETTINGS::LOCALE:AVAILABLE', + ], [ + 'value' => 'en,de,fr,es', + 'type' => 'string', + 'description' => 'The available languages' + ]); + //Locale + Settings::firstOrCreate([ + 'key' => 'SETTINGS::LOCALE:DATATABLES', + ], [ + 'value' => 'en-gb', + 'type' => 'string', + 'description' => 'The Language of the Datatables. Grab the Language-Codes from here https://datatables.net/plug-ins/i18n/' + ]); } } diff --git a/resources/views/admin/settings/tabs/language.blade.php b/resources/views/admin/settings/tabs/language.blade.php index c9896f24..d163f3bb 100644 --- a/resources/views/admin/settings/tabs/language.blade.php +++ b/resources/views/admin/settings/tabs/language.blade.php @@ -33,8 +33,19 @@ + + + + + +
-
-
+ - - - - - - - - - - - + - - {{-- --}} - {{-- --}} - {{-- --}} - {{-- --}} - - - - - - - +
- - - - - - - - - --}} +{{-- --}} +{{-- --}} +{{-- --}} + + + + + + + + + + + + + + + + + + } + }) + @endif + From d89c394ba54bc113e29658e5207808f5f38550f7 Mon Sep 17 00:00:00 2001 From: 1Day Date: Wed, 5 Jan 2022 15:19:48 +0100 Subject: [PATCH 21/60] localization, fixes, formatting --- app/Http/Middleware/SetLocale.php | 2 +- .../admin/settings/tabs/language.blade.php | 26 +- resources/views/layouts/main.blade.php | 713 +++++++++--------- 3 files changed, 373 insertions(+), 368 deletions(-) diff --git a/app/Http/Middleware/SetLocale.php b/app/Http/Middleware/SetLocale.php index 1af99c01..85fd13e9 100644 --- a/app/Http/Middleware/SetLocale.php +++ b/app/Http/Middleware/SetLocale.php @@ -24,7 +24,7 @@ class SetLocale if (Session::has('locale')) { $locale = Session::get('locale', Settings::getValueByKey("SETTINGS::LOCALE:DEFAULT")); } else { - if (Settings::getValueByKey("SETTINGS::LOCALE:DYNAMIC") == "false") { + if (!Settings::getValueByKey("SETTINGS::LOCALE:DYNAMIC")=="true") { $locale = Settings::getValueByKey("SETTINGS::LOCALE:DEFAULT"); } else { $locale = substr($request->server('HTTP_ACCEPT_LANGUAGE'), 0, 2); diff --git a/resources/views/admin/settings/tabs/language.blade.php b/resources/views/admin/settings/tabs/language.blade.php index 0aa56e65..12c86dc6 100644 --- a/resources/views/admin/settings/tabs/language.blade.php +++ b/resources/views/admin/settings/tabs/language.blade.php @@ -7,16 +7,20 @@
+ + +
- -
+

+ + @@ -65,11 +75,13 @@ class="fas fa-info-circle">
-
+ + - - + + + diff --git a/resources/views/layouts/main.blade.php b/resources/views/layouts/main.blade.php index 29e1fa9c..5e0ea4e5 100644 --- a/resources/views/layouts/main.blade.php +++ b/resources/views/layouts/main.blade.php @@ -8,446 +8,439 @@ {{ config('app.name', 'Laravel') }} + href="{{ \Illuminate\Support\Facades\Storage::disk('public')->exists('favicon.ico') ? asset('storage/favicon.ico') : asset('favicon.ico') }}" + type="image/x-icon"> {{-- --}} - + {{-- summernote --}} {{-- datetimepicker --}} + href="{{ asset('plugins/tempusdominus-bootstrap-4/css/tempusdominus-bootstrap-4.min.css') }}"> {{-- select2 --}} + onload="this.onload=null;this.rel='stylesheet'"> -
- - - - -
+ + + + + + + - + -
- @if (!Auth::user()->hasVerifiedEmail()) - @if (Auth::user()->created_at->diffInHours(now(), false) > 1) -
-
{{ __('Warning!') }}
- {{ __('You have not yet verified your email address') }} {{ __('Click here to resend verification email') }} -
- {{ __('Please contact support If you didnt receive your verification email.') }} -
+ + + + + + + + + + + + + + + + + {{-- --}} + + {{-- --}} + + {{-- --}} + + + + + + + + + + + + + @endif + + + + +
+ + + + + +
+ + @if (!Auth::user()->hasVerifiedEmail()) + @if (Auth::user()->created_at->diffInHours(now(), false) > 1) +
+
{{ __('Warning!') }}
+ {{ __('You have not yet verified your email address') }} {{ __('Click here to resend verification email') }} +
+ {{ __('Please contact support If you didnt receive your verification email.') }} +
+ @endif @endif + + @yield('content') + + @include('models.redeem_voucher_modal') +
+ + + + + + + + + + + {{-- --}} + {{-- --}} + {{-- --}} + {{-- --}} + + + + + + + + + + + + + + + + + --}} -{{-- --}} -{{-- --}} -{{-- --}} - - - - - - - - - - - - - - - - - + } + }) + @endif + From 301dc994315b26a887bc974539245b32db7942d0 Mon Sep 17 00:00:00 2001 From: 1Day Date: Wed, 5 Jan 2022 15:29:08 +0100 Subject: [PATCH 22/60] Reset locale when changes are made - added to translation file --- app/Classes/Settings/LanguageSettingsC.php | 2 ++ resources/lang/en.json | 33 +++++++++++++++++----- 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/app/Classes/Settings/LanguageSettingsC.php b/app/Classes/Settings/LanguageSettingsC.php index d96c3be7..18604b54 100644 --- a/app/Classes/Settings/LanguageSettingsC.php +++ b/app/Classes/Settings/LanguageSettingsC.php @@ -5,6 +5,7 @@ namespace App\Classes\Settings; use App\Models\Settings; use Illuminate\Http\Request; use Illuminate\Support\Facades\Cache; +use Illuminate\Support\Facades\Session; class LanguageSettingsC { @@ -32,6 +33,7 @@ class LanguageSettingsC foreach ($values as $key => $value) { Settings::where('key', $key)->update(['value' => $request->get($value)]); Cache::forget("setting" . ':' . $key); + Session::remove("locale"); } diff --git a/resources/lang/en.json b/resources/lang/en.json index fdc7563c..50f2126e 100644 --- a/resources/lang/en.json +++ b/resources/lang/en.json @@ -4,11 +4,12 @@ "api key has been removed!": "api key has been removed!", "Edit": "Edit", "Delete": "Delete", - "configuration has been updated!": "configuration has been updated!", "Store item has been created!": "Store item has been created!", "Store item has been updated!": "Store item has been updated!", "Product has been updated!": "Product has been updated!", "Store item has been removed!": "Store item has been removed!", + "Created at": "Created at", + "Error!": "Error!", "unknown": "unknown", "Pterodactyl synced": "Pterodactyl synced", "Your credit balance has been increased!": "Your credit balance has been increased!", @@ -16,6 +17,7 @@ "Your payment has been canceled!": "Your payment has been canceled!", "Payment method": "Payment method", "Invoice": "Invoice", + "Download": "Download", "Product has been created!": "Product has been created!", "Product has been removed!": "Product has been removed!", "Show": "Show", @@ -26,6 +28,7 @@ "Unsuspend": "Unsuspend", "Suspend": "Suspend", "Icons updated!": "Icons updated!", + "configuration has been updated!": "configuration has been updated!", "link has been created!": "link has been created!", "link has been updated!": "link has been updated!", "product has been removed!": "product has been removed!", @@ -80,7 +83,6 @@ "Check the docs for it here": "Check the docs for it here", "Causer": "Causer", "Description": "Description", - "Created at": "Created at", "Application API": "Application API", "Create": "Create", "Memo": "Memo", @@ -111,6 +113,7 @@ "Locations": "Locations", "Eggs": "Eggs", "Last updated :date": "Last updated :date", + "Download all Invoices": "Download all Invoices", "Product Price": "Product Price", "Tax Value": "Tax Value", "Tax Percentage": "Tax Percentage", @@ -153,7 +156,6 @@ "Select panel icon": "Select panel icon", "Select panel favicon": "Select panel favicon", "Images and Icons may be cached, reload without cache to see your changes appear": "Images and Icons may be cached, reload without cache to see your changes appear", - "Download all Invoices": "Download all Invoices", "Enter your companys name": "Enter your companys name", "Enter your companys address": "Enter your companys address", "Enter your companys phone number": "Enter your companys phone number", @@ -163,6 +165,15 @@ "Enter your custom invoice prefix": "Enter your custom invoice prefix", "Logo": "Logo", "Select Invoice Logo": "Select Invoice Logo", + "Available languages": "Available languages", + "Default language": "Default language", + "The fallback Language, if something goes wrong": "The fallback Language, if something goes wrong", + "Datable language": "Datable language", + "The Language of the Datatables. Grab the Language-Codes from here": "The Language of the Datatables. Grab the Language-Codes from here", + "Auto-translate": "Auto-translate", + "If this is checked, the Dashboard will translate itself to the Clients language, if available": "If this is checked, the Dashboard will translate itself to the Clients language, if available", + "Let the Client change the Language": "Let the Client change the Language", + "If this is checked, Clients will have the ability to manually change their Dashboard language": "If this is checked, Clients will have the ability to manually change their Dashboard language", "Store": "Store", "Currency code": "Currency code", "Checkout the paypal docs to select the appropriate code": "Checkout the paypal docs to select the appropriate code", @@ -240,7 +251,7 @@ "per month": "per month", "Out of Credits in": "Out of Credits in", "Home": "Home", - "Languages": "Languages", + "Language": "Language", "See all Notifications": "See all Notifications", "Redeem code": "Redeem code", "Profile": "Profile", @@ -278,7 +289,6 @@ "Re-Sync Discord": "Re-Sync Discord", "Save Changes": "Save Changes", "Server configuration": "Server configuration", - "Error!": "Error!", "Make sure to link your products to nodes and eggs.": "Make sure to link your products to nodes and eggs.", "There has to be at least 1 valid product for server creation": "There has to be at least 1 valid product for server creation", "No products available!": "No products available!", @@ -344,5 +354,14 @@ "Total amount": "Total amount", "Notes": "Notes", "Amount in words": "Amount in words", - "Please pay until": "Please pay until" -} \ No newline at end of file + "Please pay until": "Please pay until", + "fr": "French", + "cs": "Czech", + "en": "English", + "es": "Spanish", + "de": "German", + "hi": "Hindi", + "it": "Italian", + "pl": "Polish", + "zh": "Chinese" +} From f03303fad54779dd08e29c55ac92669de963d9e9 Mon Sep 17 00:00:00 2001 From: 1Day Date: Wed, 5 Jan 2022 15:31:49 +0100 Subject: [PATCH 23/60] Update web.php --- routes/web.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/routes/web.php b/routes/web.php index 57dedf2d..72ee4425 100644 --- a/routes/web.php +++ b/routes/web.php @@ -23,6 +23,8 @@ use App\Http\Controllers\TranslationController; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Route; +use App\Classes\Settings\LanguageSettingsC; +use App\Classes\Settings\InvoiceSettingsC; /* |-------------------------------------------------------------------------- @@ -131,8 +133,8 @@ Route::middleware(['auth', 'checkSuspended'])->group(function () { #settings Route::patch('settings/update/icons', [SettingsController::class, 'updateIcons'])->name('settings.update.icons'); - Route::patch('settings/update/invoice-settings', [\App\Classes\Settings\InvoiceSettingsC::class, 'updateInvoiceSettings'])->name('settings.update.invoicesettings'); - Route::patch('settings/update/language', [\App\Classes\Settings\LanguageSettingsC::class, 'updateLanguageSettings'])->name('settings.update.languagesettings'); + Route::patch('settings/update/invoice-settings', [InvoiceSettingsC::class, 'updateInvoiceSettings'])->name('settings.update.invoicesettings'); + Route::patch('settings/update/language', [LanguageSettingsC::class, 'updateLanguageSettings'])->name('settings.update.languagesettings'); Route::resource('settings', SettingsController::class)->only('index'); #invoices From 96f5f45b585430c92cb88baa1b075f1634d6a1cb Mon Sep 17 00:00:00 2001 From: IceToast Date: Wed, 5 Jan 2022 18:56:51 +0100 Subject: [PATCH 24/60] =?UTF-8?q?feat:=20=E2=9C=A8=20Added=20db=20migratio?= =?UTF-8?q?n=20->=20configurations=20to=20settings=20table?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...022_01_05_071040_create_settings_table.php | 35 ----------- ..._05_144858_rename_configurations_table.php | 61 +++++++++++++++++++ 2 files changed, 61 insertions(+), 35 deletions(-) delete mode 100644 database/migrations/2022_01_05_071040_create_settings_table.php create mode 100644 database/migrations/2022_01_05_144858_rename_configurations_table.php diff --git a/database/migrations/2022_01_05_071040_create_settings_table.php b/database/migrations/2022_01_05_071040_create_settings_table.php deleted file mode 100644 index 92070000..00000000 --- a/database/migrations/2022_01_05_071040_create_settings_table.php +++ /dev/null @@ -1,35 +0,0 @@ -id(); - $table->string('key'); - $table->string('value')->nullable(); - $table->string('type'); - $table->string('description'); - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('settings'); - } -} diff --git a/database/migrations/2022_01_05_144858_rename_configurations_table.php b/database/migrations/2022_01_05_144858_rename_configurations_table.php new file mode 100644 index 00000000..81b4c5a9 --- /dev/null +++ b/database/migrations/2022_01_05_144858_rename_configurations_table.php @@ -0,0 +1,61 @@ +where('key', 'INITIAL_CREDITS')->update(['key' => 'SETTINGS::USER:INITIAL_CREDITS']); + DB::table('settings')->where('key', 'INITIAL_SERVER_LIMIT')->update(['key' => 'SETTINGS::USER:INITIAL_SERVER_LIMIT']); + DB::table('settings')->where('key', 'CREDITS_REWARD_AFTER_VERIFY_EMAIL')->update(['key' => 'SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_EMAIL']); + DB::table('settings')->where('key', 'SERVER_LIMIT_REWARD_AFTER_VERIFY_EMAIL')->update(['key' => 'SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_EMAIL']); + DB::table('settings')->where('key', 'CREDITS_REWARD_AFTER_VERIFY_DISCORD')->update(['key' => 'SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_DISCORD']); + DB::table('settings')->where('key', 'SERVER_LIMIT_REWARD_AFTER_VERIFY_DISCORD')->update(['key' => 'SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_DISCORD']); + DB::table('settings')->where('key', 'MINIMUM_REQUIRED_CREDITS_TO_MAKE_SERVER')->update(['key' => 'SETTINGS::USER:MINIMUM_REQUIRED_CREDITS_TO_MAKE_SERVER']); + DB::table('settings')->where('key', 'SERVER_LIMIT_AFTER_IRL_PURCHASE')->update(['key' => 'SETTINGS::USER:SERVER_LIMIT_AFTER_IRL_PURCHASE']); + DB::table('settings')->where('key', 'FORCE_EMAIL_VERIFICATION')->update(['key' => 'SETTINGS::USER:FORCE_EMAIL_VERIFICATION']); + DB::table('settings')->where('key', 'FORCE_DISCORD_VERIFICATION')->update(['key' => 'SETTINGS::USER:FORCE_DISCORD_VERIFICATION']); + DB::table('settings')->where('key', 'REGISTER_IP_CHECK')->update(['key' => 'SETTINGS::SYSTEM:REGISTER_IP_CHECK']); + DB::table('settings')->where('key', 'CREDITS_DISPLAY_NAME')->update(['key' => 'SETTINGS::SYSTEM:CREDITS_DISPLAY_NAME']); + DB::table('settings')->where('key', 'ALLOCATION_LIMIT')->update(['key' => 'SETTINGS::SERVER:ALLOCATION_LIMIT']); + DB::table('settings')->where('key', 'SERVER_CREATE_CHARGE_FIRST_HOUR')->update(['key' => 'SETTINGS::SYSTEM:SERVER_CREATE_CHARGE_FIRST_HOUR']); + DB::table('settings')->where('key', 'SALES_TAX')->update(['key' => 'SETTINGS::PAYMENTS:SALES_TAX']); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::rename('settings', 'configurations'); + + DB::table('configurations')->where('key', 'SETTINGS::USER:INITIAL_CREDITS')->update(['key' => 'INITIAL_CREDITS']); + DB::table('configurations')->where('key', 'SETTINGS::USER:INITIAL_SERVER_LIMIT')->update(['key' => 'INITIAL_SERVER_LIMIT']); + DB::table('configurations')->where('key', 'SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_EMAIL')->update(['key' => 'CREDITS_REWARD_AFTER_VERIFY_EMAIL']); + DB::table('configurations')->where('key', 'SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_EMAIL')->update(['key' => 'SERVER_LIMIT_REWARD_AFTER_VERIFY_EMAIL']); + DB::table('configurations')->where('key', 'SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_DISCORD')->update(['key' => 'CREDITS_REWARD_AFTER_VERIFY_DISCORD']); + DB::table('configurations')->where('key', 'SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_DISCORD')->update(['key' => 'SERVER_LIMIT_REWARD_AFTER_VERIFY_DISCORD']); + DB::table('configurations')->where('key', 'SETTINGS::USER:MINIMUM_REQUIRED_CREDITS_TO_MAKE_SERVER')->update(['key' => 'MINIMUM_REQUIRED_CREDITS_TO_MAKE_SERVER']); + DB::table('configurations')->where('key', 'SETTINGS::USER:SERVER_LIMIT_AFTER_IRL_PURCHASE')->update(['key' => 'SERVER_LIMIT_AFTER_IRL_PURCHASE']); + DB::table('configurations')->where('key', 'SETTINGS::USER:FORCE_EMAIL_VERIFICATION')->update(['key' => 'FORCE_EMAIL_VERIFICATION']); + DB::table('configurations')->where('key', 'SETTINGS::USER:FORCE_DISCORD_VERIFICATION')->update(['key' => 'FORCE_DISCORD_VERIFICATION']); + DB::table('configurations')->where('key', 'SETTINGS::SYSTEM:REGISTER_IP_CHECK')->update(['key' => 'REGISTER_IP_CHECK']); + DB::table('configurations')->where('key', 'SETTINGS::SYSTEM:SERVER_CREATE_CHARGE_FIRST_HOUR')->update(['key' => 'SERVER_CREATE_CHARGE_FIRST_HOUR']); + DB::table('configurations')->where('key', 'SETTINGS::SERVER:ALLOCATION_LIMIT')->update(['key' => 'ALLOCATION_LIMIT']); + DB::table('configurations')->where('key', 'SETTINGS::SERVER:CREDITS_DISPLAY_NAME')->update(['key' => 'SETTINGS::SYSTEM:CREDITS_DISPLAY_NAME']); + DB::table('configurations')->where('key', 'SETTINGS::PAYMENTS:SALES_TAX')->update(['key' => 'SALES_TAX']); + } +} From ac190ecd17714e9608a07af252cc215d64b1e08b Mon Sep 17 00:00:00 2001 From: IceToast Date: Wed, 5 Jan 2022 21:54:49 +0100 Subject: [PATCH 25/60] =?UTF-8?q?refactor:=20=F0=9F=9A=9A=20renamed=20Sett?= =?UTF-8?q?ings=20Classes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Settings/{InvoiceSettingsC.php => Invoices.php} | 9 ++++----- .../Settings/{LanguageSettingsC.php => Language.php} | 2 +- .../tabs/{invoice.blade.php => invoices.blade.php} | 2 +- routes/web.php | 8 ++++---- 4 files changed, 10 insertions(+), 11 deletions(-) rename app/Classes/Settings/{InvoiceSettingsC.php => Invoices.php} (90%) rename app/Classes/Settings/{LanguageSettingsC.php => Language.php} (97%) rename resources/views/admin/settings/tabs/{invoice.blade.php => invoices.blade.php} (98%) diff --git a/app/Classes/Settings/InvoiceSettingsC.php b/app/Classes/Settings/Invoices.php similarity index 90% rename from app/Classes/Settings/InvoiceSettingsC.php rename to app/Classes/Settings/Invoices.php index 6f098897..c6e0aacc 100644 --- a/app/Classes/Settings/InvoiceSettingsC.php +++ b/app/Classes/Settings/Invoices.php @@ -6,7 +6,7 @@ use App\Models\Settings; use Illuminate\Http\Request; use Illuminate\Support\Facades\Cache; -class InvoiceSettingsC +class Invoices { public $tabTitle = 'Invoice Settings'; public $invoiceSettings; @@ -23,7 +23,7 @@ class InvoiceSettingsC 'logo' => 'nullable|max:10000|mimes:jpg,png,jpeg', ]); - $values=[ + $values = [ //SETTINGS::VALUE => REQUEST-VALUE (coming from the html-form) "SETTINGS::INVOICE:COMPANY_NAME" => "company-name", "SETTINGS::INVOICE:COMPANY_ADDRESS" => "company-address", @@ -34,9 +34,9 @@ class InvoiceSettingsC "SETTINGS::INVOICE:PREFIX" => "invoice-prefix" ]; - foreach($values as $key=>$value){ + foreach ($values as $key => $value) { Settings::where('key', $key)->update(['value' => $request->get($value)]); - Cache::forget("setting" .':'. $key); + Cache::forget("setting" . ':' . $key); } @@ -47,5 +47,4 @@ class InvoiceSettingsC return redirect()->route('admin.settings.index')->with('success', 'Invoice settings updated!'); } - } diff --git a/app/Classes/Settings/LanguageSettingsC.php b/app/Classes/Settings/Language.php similarity index 97% rename from app/Classes/Settings/LanguageSettingsC.php rename to app/Classes/Settings/Language.php index 18604b54..4f4669a1 100644 --- a/app/Classes/Settings/LanguageSettingsC.php +++ b/app/Classes/Settings/Language.php @@ -7,7 +7,7 @@ use Illuminate\Http\Request; use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\Session; -class LanguageSettingsC +class Language { public $tabTitle = 'Language Settings'; public $languageSettings; diff --git a/resources/views/admin/settings/tabs/invoice.blade.php b/resources/views/admin/settings/tabs/invoices.blade.php similarity index 98% rename from resources/views/admin/settings/tabs/invoice.blade.php rename to resources/views/admin/settings/tabs/invoices.blade.php index 07e1f0cf..e8875dc6 100644 --- a/resources/views/admin/settings/tabs/invoice.blade.php +++ b/resources/views/admin/settings/tabs/invoices.blade.php @@ -1,4 +1,4 @@ -@inject('Invoices', 'App\Classes\Settings\InvoiceSettingsC') +@inject('Invoices', 'App\Classes\Settings\Invoices') @inject('Settings', 'App\Models\Settings')
diff --git a/routes/web.php b/routes/web.php index 72ee4425..d449cce8 100644 --- a/routes/web.php +++ b/routes/web.php @@ -23,8 +23,8 @@ use App\Http\Controllers\TranslationController; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Route; -use App\Classes\Settings\LanguageSettingsC; -use App\Classes\Settings\InvoiceSettingsC; +use App\Classes\Settings\Language; +use App\Classes\Settings\Invoices; /* |-------------------------------------------------------------------------- @@ -133,8 +133,8 @@ Route::middleware(['auth', 'checkSuspended'])->group(function () { #settings Route::patch('settings/update/icons', [SettingsController::class, 'updateIcons'])->name('settings.update.icons'); - Route::patch('settings/update/invoice-settings', [InvoiceSettingsC::class, 'updateInvoiceSettings'])->name('settings.update.invoicesettings'); - Route::patch('settings/update/language', [LanguageSettingsC::class, 'updateLanguageSettings'])->name('settings.update.languagesettings'); + Route::patch('settings/update/invoice-settings', [Invoices::class, 'updateInvoiceSettings'])->name('settings.update.invoicesettings'); + Route::patch('settings/update/language', [Language::class, 'updateLanguageSettings'])->name('settings.update.languagesettings'); Route::resource('settings', SettingsController::class)->only('index'); #invoices From b245a54eee359df4cd24d6da9deb1b9cbc30ecbc Mon Sep 17 00:00:00 2001 From: 1Day Date: Fri, 7 Jan 2022 08:04:33 +0100 Subject: [PATCH 26/60] fix some db-handling errors --- app/Classes/Settings/Invoices.php | 6 +++++- app/Classes/Settings/Language.php | 7 ++++++- resources/views/admin/settings/tabs/invoices.blade.php | 3 +-- resources/views/admin/settings/tabs/language.blade.php | 4 ++-- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/app/Classes/Settings/Invoices.php b/app/Classes/Settings/Invoices.php index c6e0aacc..da66eceb 100644 --- a/app/Classes/Settings/Invoices.php +++ b/app/Classes/Settings/Invoices.php @@ -35,7 +35,11 @@ class Invoices ]; foreach ($values as $key => $value) { - Settings::where('key', $key)->update(['value' => $request->get($value)]); + $param = $request->get($value); + if (!$param) { + $param = ""; + } + Settings::where('key', $key)->update(['value' => $param]); Cache::forget("setting" . ':' . $key); } diff --git a/app/Classes/Settings/Language.php b/app/Classes/Settings/Language.php index 4f4669a1..e6273694 100644 --- a/app/Classes/Settings/Language.php +++ b/app/Classes/Settings/Language.php @@ -30,8 +30,13 @@ class Language "SETTINGS::LOCALE:DATATABLES" => "datatable-language" ]; + foreach ($values as $key => $value) { - Settings::where('key', $key)->update(['value' => $request->get($value)]); + $param = $request->get($value); + if (!$param) { + $param = "false"; + } + Settings::where('key', $key)->update(['value' => $param]); Cache::forget("setting" . ':' . $key); Session::remove("locale"); } diff --git a/resources/views/admin/settings/tabs/invoices.blade.php b/resources/views/admin/settings/tabs/invoices.blade.php index e8875dc6..6b64eae9 100644 --- a/resources/views/admin/settings/tabs/invoices.blade.php +++ b/resources/views/admin/settings/tabs/invoices.blade.php @@ -1,7 +1,6 @@ @inject('Invoices', 'App\Classes\Settings\Invoices') -@inject('Settings', 'App\Models\Settings') -
+
@csrf diff --git a/resources/views/admin/settings/tabs/language.blade.php b/resources/views/admin/settings/tabs/language.blade.php index 12c86dc6..289935cc 100644 --- a/resources/views/admin/settings/tabs/language.blade.php +++ b/resources/views/admin/settings/tabs/language.blade.php @@ -55,7 +55,7 @@
-
- -
- - - -
diff --git a/resources/views/admin/settings/tabs/invoices.blade.php b/resources/views/admin/settings/tabs/invoices.blade.php index cf972d11..383dc1be 100644 --- a/resources/views/admin/settings/tabs/invoices.blade.php +++ b/resources/views/admin/settings/tabs/invoices.blade.php @@ -1,5 +1,3 @@ -@inject('Invoices', 'App\Classes\Settings\Invoices') -
diff --git a/resources/views/admin/settings/tabs/misc.blade.php b/resources/views/admin/settings/tabs/misc.blade.php index 300a811b..b34ff386 100644 --- a/resources/views/admin/settings/tabs/misc.blade.php +++ b/resources/views/admin/settings/tabs/misc.blade.php @@ -6,21 +6,6 @@
- - - - - -
-
- - -
-
-
+ + @csrf + @method('PATCH') + +
+
+ + +
+
+ +
diff --git a/routes/web.php b/routes/web.php index f44a84d6..936ea04a 100644 --- a/routes/web.php +++ b/routes/web.php @@ -27,6 +27,7 @@ use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Route; use App\Classes\Settings\Language; use App\Classes\Settings\Invoices; +use App\Classes\Settings\System; /* |-------------------------------------------------------------------------- @@ -134,10 +135,11 @@ Route::middleware(['auth', 'checkSuspended'])->group(function () { Route::patch('settings/updatevalue', [SettingsController::class, 'updatevalue'])->name('settings.updatevalue'); #settings - Route::patch('settings/update/invoice-settings', [Invoices::class, 'updateInvoiceSettings'])->name('settings.update.invoicesettings'); - Route::patch('settings/update/language', [Language::class, 'updateLanguageSettings'])->name('settings.update.languagesettings'); - Route::patch('settings/update/payment', [Payments::class, 'updatePaymentSettings'])->name('settings.update.paymentsettings'); - Route::patch('settings/update/misc', [Misc::class, 'updateMiscSettings'])->name('settings.update.miscsettings'); + Route::patch('settings/update/invoice-settings', [Invoices::class, 'updateSettings'])->name('settings.update.invoicesettings'); + Route::patch('settings/update/language', [Language::class, 'updateSettings'])->name('settings.update.languagesettings'); + Route::patch('settings/update/payment', [Payments::class, 'updateSettings'])->name('settings.update.paymentsettings'); + Route::patch('settings/update/misc', [Misc::class, 'updateSettings'])->name('settings.update.miscsettings'); + Route::patch('settings/update/system', [System::class, 'updateSettings'])->name('settings.update.systemsettings'); Route::resource('settings', SettingsController::class)->only('index'); #invoices From 6e0eff0eaf16ad38d7af33d76241845c2b97893a Mon Sep 17 00:00:00 2001 From: IceToast Date: Fri, 14 Jan 2022 18:25:23 +0100 Subject: [PATCH 42/60] =?UTF-8?q?feat:=20=F0=9F=92=84=20Styled=20Misc-Sett?= =?UTF-8?q?ings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/admin/settings/tabs/misc.blade.php | 60 ++++++------------- .../admin/settings/tabs/system.blade.php | 28 +++++++++ 2 files changed, 46 insertions(+), 42 deletions(-) diff --git a/resources/views/admin/settings/tabs/misc.blade.php b/resources/views/admin/settings/tabs/misc.blade.php index b34ff386..6f03fa5e 100644 --- a/resources/views/admin/settings/tabs/misc.blade.php +++ b/resources/views/admin/settings/tabs/misc.blade.php @@ -5,48 +5,26 @@ @method('PATCH')
-
-
-
- - -
- @error('icon') - - {{ $message }} - - @enderror -
-
-
- - -
- @error('favicon') - - {{ $message }} - - @enderror -
-
+
- - - +
+
+
+ ({{ __('optional') }}) +
+
- +
+
- + @@ -55,7 +33,7 @@
- + @@ -64,7 +42,7 @@
- + @@ -73,7 +51,7 @@
- + @@ -82,8 +60,7 @@
-
-
- + + + -

- {{ __('Images and Icons may be cached, reload without cache to see your changes appear') }} -

+
diff --git a/resources/views/admin/settings/tabs/system.blade.php b/resources/views/admin/settings/tabs/system.blade.php index f21f3525..2976e391 100644 --- a/resources/views/admin/settings/tabs/system.blade.php +++ b/resources/views/admin/settings/tabs/system.blade.php @@ -13,4 +13,32 @@
+
+
+
+ + +
+ @error('icon') + + {{ $message }} + + @enderror +
+
+
+ + +
+ @error('favicon') + + {{ $message }} + + @enderror +
+
+ + +
From 93992dfc46e165b25dd086765d3ded38c5a3199a Mon Sep 17 00:00:00 2001 From: IceToast Date: Fri, 14 Jan 2022 19:08:38 +0100 Subject: [PATCH 43/60] =?UTF-8?q?style:=20=F0=9F=92=84=20restyled=20misc,?= =?UTF-8?q?=20invoices=20and=20payment=20Settings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/admin/settings/index.blade.php | 11 +- .../admin/settings/tabs/invoices.blade.php | 47 +++---- .../admin/settings/tabs/language.blade.php | 2 +- .../views/admin/settings/tabs/misc.blade.php | 39 +++--- .../{payments.blade.php => payment.blade.php} | 123 ++++++++++-------- 5 files changed, 119 insertions(+), 103 deletions(-) rename resources/views/admin/settings/tabs/{payments.blade.php => payment.blade.php} (52%) diff --git a/resources/views/admin/settings/index.blade.php b/resources/views/admin/settings/index.blade.php index b3fd4e18..54c17954 100644 --- a/resources/views/admin/settings/index.blade.php +++ b/resources/views/admin/settings/index.blade.php @@ -67,16 +67,25 @@ diff --git a/resources/views/admin/settings/tabs/invoices.blade.php b/resources/views/admin/settings/tabs/invoices.blade.php index 383dc1be..ff097709 100644 --- a/resources/views/admin/settings/tabs/invoices.blade.php +++ b/resources/views/admin/settings/tabs/invoices.blade.php @@ -5,11 +5,11 @@ @method('PATCH')
-
+
-
- +
+ @@ -17,8 +17,8 @@
-
- +
+ @@ -26,8 +26,8 @@
-
- +
+ @@ -36,19 +36,20 @@
-
- +
+
-
+ +
-
- +
+ @@ -56,8 +57,8 @@
-
- +
+ @@ -66,18 +67,19 @@
-
- +
+
- +
+
-
- +
+
@@ -90,12 +92,11 @@ @enderror
-
- - - +
+ +
diff --git a/resources/views/admin/settings/tabs/language.blade.php b/resources/views/admin/settings/tabs/language.blade.php index f5c649f3..1cd3bbf7 100644 --- a/resources/views/admin/settings/tabs/language.blade.php +++ b/resources/views/admin/settings/tabs/language.blade.php @@ -5,7 +5,7 @@ @method('PATCH')
-
+
diff --git a/resources/views/admin/settings/tabs/misc.blade.php b/resources/views/admin/settings/tabs/misc.blade.php index 6f03fa5e..2d82d647 100644 --- a/resources/views/admin/settings/tabs/misc.blade.php +++ b/resources/views/admin/settings/tabs/misc.blade.php @@ -6,16 +6,15 @@
-
+
-
-
- ({{ __('optional') }}) +
+

Discord

-
- +
+ @@ -23,8 +22,8 @@
-
- +
+ @@ -32,8 +31,8 @@
-
- +
+ @@ -41,8 +40,8 @@
-
- +
+ @@ -50,8 +49,8 @@
-
- +
+ @@ -59,9 +58,8 @@
-
- +
+ @@ -72,10 +70,9 @@
+
+ - +
- - -
diff --git a/resources/views/admin/settings/tabs/payments.blade.php b/resources/views/admin/settings/tabs/payment.blade.php similarity index 52% rename from resources/views/admin/settings/tabs/payments.blade.php rename to resources/views/admin/settings/tabs/payment.blade.php index 66ccb0c1..cb2f1685 100644 --- a/resources/views/admin/settings/tabs/payments.blade.php +++ b/resources/views/admin/settings/tabs/payment.blade.php @@ -1,72 +1,77 @@ -
+
@csrf @method('PATCH')
-
- - + {{-- PayPal --}} +
+
+
+

PayPal

+
+
+
-
- +
+
-
-
- +
+
- +
-
- +
+ + ({{ __('optional') }})
-
-
- +
+ + ({{ __('optional') }})
-
- - + {{-- Stripe --}} +
+ +
+
+

Stripe

+
+
-
- +
+
-
-
- +
+
-
-
- +
+ + ({{ __('optional') }})
-
-
- +
+ + ({{ __('optional') }})
- -
-
- +
+
+ + +
@@ -109,27 +114,31 @@
- - -
-
- - -
-
- - + {{-- Other --}} +
+
+
+

Other

+
+
+ +
+
+
+ +
+
- - - - +
+ +
From f12c4f7d53b5646f7d3d6344af6ba0508a62f5f4 Mon Sep 17 00:00:00 2001 From: IceToast Date: Fri, 14 Jan 2022 20:01:21 +0100 Subject: [PATCH 44/60] =?UTF-8?q?style:=20=F0=9F=8E=A8=20improved=20stylin?= =?UTF-8?q?g?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/settings/tabs/invoices.blade.php | 32 ++--- .../admin/settings/tabs/language.blade.php | 112 ++++++++++-------- .../views/admin/settings/tabs/misc.blade.php | 32 +++-- .../admin/settings/tabs/payment.blade.php | 46 +++---- 4 files changed, 117 insertions(+), 105 deletions(-) diff --git a/resources/views/admin/settings/tabs/invoices.blade.php b/resources/views/admin/settings/tabs/invoices.blade.php index ff097709..1c1b46e6 100644 --- a/resources/views/admin/settings/tabs/invoices.blade.php +++ b/resources/views/admin/settings/tabs/invoices.blade.php @@ -7,8 +7,8 @@
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
- - - - +
+ + +
-
+ +
+ + + +
+
+
+ + +
+ + +
+ + - -
+
- - - + + + + +
- - -
- - - -
- - - - - +
+
-
diff --git a/resources/views/admin/settings/tabs/misc.blade.php b/resources/views/admin/settings/tabs/misc.blade.php index 2d82d647..f0d65a6c 100644 --- a/resources/views/admin/settings/tabs/misc.blade.php +++ b/resources/views/admin/settings/tabs/misc.blade.php @@ -6,14 +6,15 @@
-
-
+
+

Discord

-
-
+ +
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
- -
-
diff --git a/resources/views/admin/settings/tabs/payment.blade.php b/resources/views/admin/settings/tabs/payment.blade.php index cb2f1685..063c9e47 100644 --- a/resources/views/admin/settings/tabs/payment.blade.php +++ b/resources/views/admin/settings/tabs/payment.blade.php @@ -7,14 +7,14 @@
{{-- PayPal --}}
-
+

PayPal

-
-
+
+
-
-
+
+
-
-
+
+
({{ __('optional') }})
-
-
+
+
({{ __('optional') }}) -
+

Stripe

-
-
+
+
-
-
+
+
-
-
+
+
({{ __('optional') }})
-
-
+
+
({{ __('optional') }})
-
-
+
+
-
+

Other

-
-
+
+
Date: Fri, 14 Jan 2022 20:42:25 +0100 Subject: [PATCH 45/60] =?UTF-8?q?feat:=20=E2=9C=A8=20Added=20and=20styled?= =?UTF-8?q?=20all=20"configurations"=20to=20System-Settings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/settings/tabs/language.blade.php | 4 +- .../admin/settings/tabs/system.blade.php | 209 +++++++++++++++--- 2 files changed, 178 insertions(+), 35 deletions(-) diff --git a/resources/views/admin/settings/tabs/language.blade.php b/resources/views/admin/settings/tabs/language.blade.php index fc77a618..c4bd2e65 100644 --- a/resources/views/admin/settings/tabs/language.blade.php +++ b/resources/views/admin/settings/tabs/language.blade.php @@ -68,8 +68,8 @@ - diff --git a/resources/views/admin/settings/tabs/system.blade.php b/resources/views/admin/settings/tabs/system.blade.php index 2976e391..360daf8a 100644 --- a/resources/views/admin/settings/tabs/system.blade.php +++ b/resources/views/admin/settings/tabs/system.blade.php @@ -4,41 +4,184 @@ @csrf @method('PATCH') -
-
- - +
+ + {{-- System --}} +
+
+
+

{{ __('Server') }}

+
+
+
+
+
+
+ + +
+ +
+
+
+
+
+ + +
+ +
+
+ +
+ + +
+
+ +
+ + +
+
+
+

{{ __('User') }}

+
+
+
+
+ + +
+
+ + +
+ +
+ + +
+
+ + +
+
+ + +
+ +
+ + +
+
+ + +
+
+ + +
+
+
+ +
+
+
+

{{ __('Server') }}

+
+
+
+
+
+ + +
+ +
+ + +
+
+ + +
+ +
+
+
+
+ + +
+ @error('icon') + + {{ $message }} + + @enderror + + +
+
+ + +
+ @error('favicon') + + {{ $message }} + + @enderror +
+
- -
-
-
- - -
- @error('icon') - - {{ $message }} - - @enderror -
-
-
- - -
- @error('favicon') - - {{ $message }} - - @enderror -
+
+
- -
From 21a86ce44d26b8a687c3e4826da33bfa4bc025d3 Mon Sep 17 00:00:00 2001 From: IceToast Date: Fri, 14 Jan 2022 21:15:07 +0100 Subject: [PATCH 46/60] =?UTF-8?q?chore:=20=E2=99=BB=EF=B8=8F=20code=20refa?= =?UTF-8?q?ctoring=20->=20cleanup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Classes/Settings/Misc.php | 1 - .../settings/tabs/configurations.blade.php | 121 ------------------ .../admin/settings/tabs/system.blade.php | 21 ++- 3 files changed, 10 insertions(+), 133 deletions(-) delete mode 100644 resources/views/admin/settings/tabs/configurations.blade.php diff --git a/app/Classes/Settings/Misc.php b/app/Classes/Settings/Misc.php index 9f551def..0eb75729 100644 --- a/app/Classes/Settings/Misc.php +++ b/app/Classes/Settings/Misc.php @@ -34,7 +34,6 @@ class Misc $values = [ //SETTINGS::VALUE => REQUEST-VALUE (coming from the html-form) - "SETTINGS::MISC:PHPMYADMIN:URL" => "phpmyadmin-url", "SETTINGS::DISCORD:BOT_TOKEN" => "discord-bot-token", "SETTINGS::DISCORD:CLIENT_ID" => "discord-client-id", "SETTINGS::DISCORD:CLIENT_SECRET" => "discord-client-secret", diff --git a/resources/views/admin/settings/tabs/configurations.blade.php b/resources/views/admin/settings/tabs/configurations.blade.php deleted file mode 100644 index 0d7e8ccc..00000000 --- a/resources/views/admin/settings/tabs/configurations.blade.php +++ /dev/null @@ -1,121 +0,0 @@ -
- - - - - - - - - - - - - -
{{ __('Key') }}{{ __('Value') }}{{ __('Type') }}{{ __('Description') }}{{ __('Created at') }}
-
- - - - - - - - - diff --git a/resources/views/admin/settings/tabs/system.blade.php b/resources/views/admin/settings/tabs/system.blade.php index 360daf8a..60ed8c13 100644 --- a/resources/views/admin/settings/tabs/system.blade.php +++ b/resources/views/admin/settings/tabs/system.blade.php @@ -5,12 +5,11 @@ @method('PATCH')
- {{-- System --}}
-

{{ __('Server') }}

+

{{ __('System') }}

@@ -45,8 +44,8 @@
+ type="text" value="{{ config('SETTINGS::SYSTEM:CREDITS_DISPLAY_NAME', 'Credits') }}" + class="form-control @error('credits-display-name') is-invalid @enderror" required>
@@ -78,13 +77,13 @@ + class="form-control @error('initial-credits') is-invalid @enderror" required>
+ class="form-control @error('initial-server-limit') is-invalid @enderror" required>
@@ -100,21 +99,21 @@ + class="form-control @error('credits-reward-amount-email') is-invalid @enderror" required>
+ class="form-control @error('server-limit-discord') is-invalid @enderror" required>
+ class="form-control @error('server-limit-email') is-invalid @enderror" required>
@@ -135,7 +134,7 @@
+ class="form-control @error('allocation-limit') is-invalid @enderror" required>
From a8c19ffe2c3be88196c93c2cebe91823cfb93932 Mon Sep 17 00:00:00 2001 From: IceToast Date: Fri, 14 Jan 2022 21:17:36 +0100 Subject: [PATCH 47/60] =?UTF-8?q?feat:=20=E2=9C=A8=20Added=20ReCaptcha=20t?= =?UTF-8?q?o=20Settings=20&=20Added=20option=20to=20dis/enable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Classes/Settings/System.php | 25 ++++++++----- database/seeders/Seeds/SettingsSeeder.php | 10 ++++- .../views/admin/settings/tabs/misc.blade.php | 37 +++++++++++++++++++ 3 files changed, 60 insertions(+), 12 deletions(-) diff --git a/app/Classes/Settings/System.php b/app/Classes/Settings/System.php index 0a9c3672..c458ebad 100644 --- a/app/Classes/Settings/System.php +++ b/app/Classes/Settings/System.php @@ -5,7 +5,6 @@ namespace App\Classes\Settings; use App\Models\Settings; use Illuminate\Http\Request; use Illuminate\Support\Facades\Cache; -use Illuminate\Support\Facades\Config; class System { @@ -20,17 +19,23 @@ class System public function updateSettings(Request $request) { - $request->validate([ - 'icon' => 'nullable|max:10000|mimes:jpg,png,jpeg', - 'favicon' => 'nullable|max:10000|mimes:ico', - ]); - - $values = [ - //SETTINGS::VALUE => REQUEST-VALUE (coming from the html-form) + "SETTINGS::SYSTEM:REGISTER_IP_CHECK" => "register-ip-check", + "SETTINGS::SYSTEM:SERVER_CREATE_CHARGE_FIRST_HOUR" => "server-create-charge-first-hour", + "SETTINGS::SYSTEM:CREDITS_DISPLAY_NAME" => "credits-display-name", + "SETTINGS::SERVER:ALLOCATION_LIMIT" => "allocation-limit", + "SETTINGS::USER:FORCE_DISCORD_VERIFICATION" => "force-discord-verification", + "SETTINGS::USER:FORCE_EMAIL_VERIFICATION" => "force-email-verification", + "SETTINGS::USER:INITIAL_CREDITS" => "initial-credits", + "SETTINGS::USER:INITIAL_SERVER_LIMIT" => "initial-server-limit", + "SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_DISCORD" => "credits-reward-amount-discord", + "SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_EMAIL" => "credits-reward-amount-email", + "SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_DISCORD" => "server-limit-discord", + "SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_EMAIL" => "server-limit-email", "SETTINGS::MISC:PHPMYADMIN:URL" => "phpmyadmin-url", - - + "SETTINGS::RECAPTCHA:SITE_KEY" => "recaptcha-site-key", + "SETTINGS::RECAPTCHA:SECRET_KEY" => "recaptcha-secret-key", + "SETTINGS::RECAPTCHA:ENABLED" => "recaptcha-enabled", ]; diff --git a/database/seeders/Seeds/SettingsSeeder.php b/database/seeders/Seeds/SettingsSeeder.php index c7010de2..4b3fc001 100644 --- a/database/seeders/Seeds/SettingsSeeder.php +++ b/database/seeders/Seeds/SettingsSeeder.php @@ -380,7 +380,7 @@ class SettingsSeeder extends Seeder ]); Settings::firstOrCreate([ - 'key' => 'SETTINGS::SYSTEM:RECAPTCHA_SITE_KEY', + 'key' => 'SETTINGS::RECAPTCHA:SITE_KEY', ], [ 'value' => '6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI', 'type' => 'string', @@ -388,11 +388,17 @@ class SettingsSeeder extends Seeder ]); Settings::firstOrCreate([ - 'key' => 'SETTINGS::SYSTEM:RECAPTCHA_SECRET_KEY', + 'key' => 'SETTINGS::RECAPTCHA:SECRET_KEY', ], [ 'value' => '6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe', 'type' => 'string', 'description' => 'Google Recaptcha API Credentials - https://www.google.com/recaptcha/admin - reCaptcha V2 (not v3)' ]); + Settings::firstOrCreate([ + 'key' => 'SETTINGS::RECAPTCHA:ENABLED', + ], [ + 'value' => 'true', + 'type' => 'boolean', + ]); } } diff --git a/resources/views/admin/settings/tabs/misc.blade.php b/resources/views/admin/settings/tabs/misc.blade.php index f0d65a6c..74ba7aee 100644 --- a/resources/views/admin/settings/tabs/misc.blade.php +++ b/resources/views/admin/settings/tabs/misc.blade.php @@ -68,6 +68,43 @@
+
+
+
+

ReCaptcha

+
+
+ +
+
+
+ + +
+
+
+ +
+
+ + +
+
+ +
+
+ + +
+
+
From cb7a757a3a93e5cf6c82b32201934eb314322254 Mon Sep 17 00:00:00 2001 From: IceToast Date: Sat, 15 Jan 2022 00:48:38 +0100 Subject: [PATCH 48/60] =?UTF-8?q?feat:=20=E2=9C=A8=20Added=20ReCaptcha=20S?= =?UTF-8?q?ettings=20in=20Class?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Classes/Settings/Misc.php | 12 +++--- app/Http/Controllers/Auth/LoginController.php | 18 ++++++--- .../Controllers/Auth/RegisterController.php | 28 +++++++------ .../admin/settings/tabs/invoices.blade.php | 2 +- resources/views/layouts/app.blade.php | 39 ++++++++++++------- 5 files changed, 57 insertions(+), 42 deletions(-) diff --git a/app/Classes/Settings/Misc.php b/app/Classes/Settings/Misc.php index 0eb75729..073b6123 100644 --- a/app/Classes/Settings/Misc.php +++ b/app/Classes/Settings/Misc.php @@ -39,8 +39,10 @@ class Misc "SETTINGS::DISCORD:CLIENT_SECRET" => "discord-client-secret", "SETTINGS::DISCORD:GUILD_ID" => "discord-guild-id", "SETTINGS::DISCORD:INVITE_URL" => "discord-invite-url", - "SETTINGS::DISCORD:ROLE_ID" => "discord-role-id" - + "SETTINGS::DISCORD:ROLE_ID" => "discord-role-id", + "SETTINGS::RECAPTCHA:SITE_KEY" => "recaptcha-site-key", + "SETTINGS::RECAPTCHA:SECRET_KEY" => "recaptcha-secret-key", + "SETTINGS::RECAPTCHA:ENABLED" => "enable-recaptcha", ]; Config::set('services.discord.client_id', $request->get("discord-client-id")); @@ -49,14 +51,12 @@ class Misc foreach ($values as $key => $value) { $param = $request->get($value); - if (!$param) { - $param = ""; - } + Settings::where('key', $key)->updateOrCreate(['key' => $key], ['value' => $param]); Cache::forget("setting" . ':' . $key); } - return redirect(route('admin.settings.index') . '#misc')->with('success', 'Misc settings updated!'); + return redirect(route('admin.settings.index') . '#misc')->with('success', __('Misc settings updated!')); } } diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index d80fb5bf..a9429689 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -41,17 +41,25 @@ class LoginController extends Controller public function login(Request $request) { - $request->validate([ + + $validationRules = [ $this->username() => 'required|string', 'password' => 'required|string', - 'g-recaptcha-response' => ['required','recaptcha'], - ]); + ]; + if (config('SETTINGS::RECAPTCHA:ENABLED') == 'true') { + $validationRules['g-recaptcha-response'] = ['required', 'recaptcha']; + } + $request->validate($validationRules); + + // If the class is using the ThrottlesLogins trait, we can automatically throttle // the login attempts for this application. We'll key this by the username and // the IP address of the client making these requests into this application. - if (method_exists($this, 'hasTooManyLoginAttempts') && - $this->hasTooManyLoginAttempts($request)) { + if ( + method_exists($this, 'hasTooManyLoginAttempts') && + $this->hasTooManyLoginAttempts($request) + ) { $this->fireLockoutEvent($request); return $this->sendLockoutResponse($request); diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index 813e7b02..922fcf18 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -53,30 +53,28 @@ class RegisterController extends Controller */ protected function validator(array $data) { + $validationRules = [ + 'name' => ['required', 'string', 'max:30', 'min:4', 'alpha_num', 'unique:users'], + 'email' => ['required', 'string', 'email', 'max:64', 'unique:users'], + 'password' => ['required', 'string', 'min:8', 'confirmed'], + ]; + if (config('SETTINGS::RECAPTCHA:ENABLED') == 'true') { + $validationRules['g-recaptcha-response'] = ['required', 'recaptcha']; + } + if (Settings::getValueByKey('SETTINGS::SYSTEM:REGISTER_IP_CHECK', 'true') == 'true') { //check if ip has already made an account $data['ip'] = session()->get('ip') ?? request()->ip(); if (User::where('ip', '=', request()->ip())->exists()) session()->put('ip', request()->ip()); + $validationRules['ip'] = ['unique:users']; - return Validator::make($data, [ - 'name' => ['required', 'string', 'max:30', 'min:4', 'alpha_num', 'unique:users'], - 'email' => ['required', 'string', 'email', 'max:64', 'unique:users'], - 'password' => ['required', 'string', 'min:8', 'confirmed'], - 'g-recaptcha-response' => ['recaptcha'], - 'ip' => ['unique:users'], - ], [ - 'ip.unique' => "You have already made an account with us! Please contact support if you think this is incorrect." + return Validator::make($data, $validationRules, [ + 'ip.unique' => "You have already made an account! Please contact support if you think this is incorrect." ]); } - return Validator::make($data, [ - 'name' => ['required', 'string', 'max:30', 'min:4', 'alpha_num', 'unique:users'], - 'email' => ['required', 'string', 'email', 'max:64', 'unique:users'], - 'password' => ['required', 'string', 'min:8', 'confirmed'], - 'g-recaptcha-response' => ['recaptcha'], - ]); - + return Validator::make($data, $validationRules); } /** diff --git a/resources/views/admin/settings/tabs/invoices.blade.php b/resources/views/admin/settings/tabs/invoices.blade.php index 1c1b46e6..f594ea04 100644 --- a/resources/views/admin/settings/tabs/invoices.blade.php +++ b/resources/views/admin/settings/tabs/invoices.blade.php @@ -1,4 +1,4 @@ -
+
@csrf diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index 0922c3bc..4f3bae60 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -1,5 +1,6 @@ + @@ -8,7 +9,9 @@ {{ config('app.name', 'Laravel') }} - + @@ -17,27 +20,32 @@ - - - - {!! htmlScriptTagJsApi() !!} + + + + @if (config('SETTINGS::RECAPTCHA:ENABLED') == 'true') + {!! htmlScriptTagJsApi() !!} + @endif @yield('content') + From 1e085982aff1c3372c0a76b956ad1576c10165d2 Mon Sep 17 00:00:00 2001 From: IceToast Date: Sat, 15 Jan 2022 00:49:07 +0100 Subject: [PATCH 49/60] =?UTF-8?q?feat:=20=E2=9C=A8=20Added=20improved=20va?= =?UTF-8?q?lidation=20in=20systemSettings=20Class?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Classes/Settings/System.php | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/app/Classes/Settings/System.php b/app/Classes/Settings/System.php index c458ebad..5b0264e6 100644 --- a/app/Classes/Settings/System.php +++ b/app/Classes/Settings/System.php @@ -5,6 +5,7 @@ namespace App\Classes\Settings; use App\Models\Settings; use Illuminate\Http\Request; use Illuminate\Support\Facades\Cache; +use Illuminate\Support\Facades\Validator; class System { @@ -19,6 +20,28 @@ class System public function updateSettings(Request $request) { + $validator = Validator::make($request->all(), [ + "register-ip-check" => "boolean", + "server-create-charge-first-hour" => "boolean", + "credits-display-name" => "required|string", + "allocation-limit" => "required|min:0|integer", + "force-email-verification" => "boolean", + "force-discord-verification" => "boolean", + "initial-credits" => "required|min:0|integer", + "initial-server-limit" => "required|min:0|integer", + "credits-reward-amount-discord" => "required|min:0|integer", + "credits-reward-amount-email" => "required|min:0|integer", + "server-limit-discord" => "required|min:0|integer", + "server-limit-email" => "required|min:0|integer", + + ]); + + if ($validator->fails()) { + return redirect(route('admin.settings.index') . '#system')->with('error', __('System settings not updated!'))->withErrors($validator) + ->withInput(); + } + + $values = [ "SETTINGS::SYSTEM:REGISTER_IP_CHECK" => "register-ip-check", "SETTINGS::SYSTEM:SERVER_CREATE_CHARGE_FIRST_HOUR" => "server-create-charge-first-hour", @@ -33,21 +56,15 @@ class System "SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_DISCORD" => "server-limit-discord", "SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_EMAIL" => "server-limit-email", "SETTINGS::MISC:PHPMYADMIN:URL" => "phpmyadmin-url", - "SETTINGS::RECAPTCHA:SITE_KEY" => "recaptcha-site-key", - "SETTINGS::RECAPTCHA:SECRET_KEY" => "recaptcha-secret-key", - "SETTINGS::RECAPTCHA:ENABLED" => "recaptcha-enabled", ]; foreach ($values as $key => $value) { $param = $request->get($value); - if (!$param) { - $param = ""; - } + Settings::where('key', $key)->updateOrCreate(['key' => $key], ['value' => $param]); Cache::forget("setting" . ':' . $key); } - - return redirect(route('admin.settings.index') . '#system')->with('success', 'System settings updated!'); + return redirect(route('admin.settings.index') . '#system')->with('success', __('System settings updated!')); } } From 4621547c010077891a27a92c6a6c79da36be59f9 Mon Sep 17 00:00:00 2001 From: IceToast Date: Sat, 15 Jan 2022 00:49:33 +0100 Subject: [PATCH 50/60] =?UTF-8?q?feat:=20=E2=9C=A8=20Allow=20value=20colum?= =?UTF-8?q?n=20in=20table=20to=20be=20nullable=20->=20can=20store=20"0"=20?= =?UTF-8?q?values?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Classes/Settings/Invoices.php | 6 ++-- app/Classes/Settings/Language.php | 6 ++-- app/Classes/Settings/Payments.php | 6 ++-- ...8_update_settings_table_allow_nullable.php | 34 +++++++++++++++++++ .../views/admin/settings/index.blade.php | 25 +++++++------- .../views/admin/settings/tabs/misc.blade.php | 15 ++++---- .../admin/settings/tabs/system.blade.php | 4 +-- resources/views/layouts/main.blade.php | 25 +++++++------- 8 files changed, 74 insertions(+), 47 deletions(-) create mode 100644 database/migrations/2022_01_14_234418_update_settings_table_allow_nullable.php diff --git a/app/Classes/Settings/Invoices.php b/app/Classes/Settings/Invoices.php index 4cca06b5..b19bb6e3 100644 --- a/app/Classes/Settings/Invoices.php +++ b/app/Classes/Settings/Invoices.php @@ -33,9 +33,7 @@ class Invoices foreach ($values as $key => $value) { $param = $request->get($value); - if (!$param) { - $param = ""; - } + Settings::where('key', $key)->updateOrCreate(['key' => $key], ['value' => $param]); 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!')); } } diff --git a/app/Classes/Settings/Language.php b/app/Classes/Settings/Language.php index 55818b1d..1d59614a 100644 --- a/app/Classes/Settings/Language.php +++ b/app/Classes/Settings/Language.php @@ -30,15 +30,13 @@ class Language foreach ($values as $key => $value) { $param = $request->get($value); - if (!$param) { - $param = "false"; - } + Settings::where('key', $key)->updateOrCreate(['key' => $key], ['value' => $param]); Cache::forget("setting" . ':' . $key); 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!')); } } diff --git a/app/Classes/Settings/Payments.php b/app/Classes/Settings/Payments.php index 7442f2b8..2accf807 100644 --- a/app/Classes/Settings/Payments.php +++ b/app/Classes/Settings/Payments.php @@ -35,14 +35,12 @@ class Payments foreach ($values as $key => $value) { $param = $request->get($value); - if (!$param) { - $param = ""; - } + Settings::where('key', $key)->updateOrCreate(['key' => $key], ['value' => $param]); 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!')); } } diff --git a/database/migrations/2022_01_14_234418_update_settings_table_allow_nullable.php b/database/migrations/2022_01_14_234418_update_settings_table_allow_nullable.php new file mode 100644 index 00000000..20d5a0c9 --- /dev/null +++ b/database/migrations/2022_01_14_234418_update_settings_table_allow_nullable.php @@ -0,0 +1,34 @@ +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(); + }); + } +} diff --git a/resources/views/admin/settings/index.blade.php b/resources/views/admin/settings/index.blade.php index 54c17954..5941c483 100644 --- a/resources/views/admin/settings/index.blade.php +++ b/resources/views/admin/settings/index.blade.php @@ -73,20 +73,19 @@ var fileName = $(this).val().split("\\").pop(); $(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); + }); diff --git a/resources/views/admin/settings/tabs/misc.blade.php b/resources/views/admin/settings/tabs/misc.blade.php index 74ba7aee..623ef94b 100644 --- a/resources/views/admin/settings/tabs/misc.blade.php +++ b/resources/views/admin/settings/tabs/misc.blade.php @@ -88,20 +88,19 @@
- - {{ __('ReCaptcha Site-Key') }}: + + class="form-control @error('recaptcha-site-key') is-invalid @enderror">
- - + +
diff --git a/resources/views/admin/settings/tabs/system.blade.php b/resources/views/admin/settings/tabs/system.blade.php index 60ed8c13..b8fc58a3 100644 --- a/resources/views/admin/settings/tabs/system.blade.php +++ b/resources/views/admin/settings/tabs/system.blade.php @@ -103,14 +103,14 @@
-
- diff --git a/resources/views/layouts/main.blade.php b/resources/views/layouts/main.blade.php index 072ef13a..2593f34f 100644 --- a/resources/views/layouts/main.blade.php +++ b/resources/views/layouts/main.blade.php @@ -32,6 +32,7 @@ + @@ -49,8 +50,8 @@ class="fas fa-home mr-2">{{ __('Home') }} @if (config('SETTINGS::LOCALE:CLIENTS_CAN_CHANGE') == 'true') @@ -390,7 +391,7 @@ {{-- --}} {{-- --}} - + @@ -404,17 +405,17 @@ - +