refactor: 🚚 renamed Settings Classes
This commit is contained in:
parent
96f5f45b58
commit
ac190ecd17
4 changed files with 10 additions and 11 deletions
|
@ -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!');
|
||||
}
|
||||
|
||||
}
|
|
@ -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;
|
|
@ -1,4 +1,4 @@
|
|||
@inject('Invoices', 'App\Classes\Settings\InvoiceSettingsC')
|
||||
@inject('Invoices', 'App\Classes\Settings\Invoices')
|
||||
@inject('Settings', 'App\Models\Settings')
|
||||
|
||||
<div class="tab-pane mt-3" id="invoice">
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue