use fallback for default settings
This commit is contained in:
@ -3,20 +3,11 @@
|
||||
namespace App\Http\Controllers\Settings;
|
||||
|
||||
use App\Abstracts\Http\Controller;
|
||||
use App\Models\Setting\Setting;
|
||||
|
||||
class Company extends Controller
|
||||
{
|
||||
public function edit()
|
||||
{
|
||||
$setting = Setting::prefix('company')->get()->transform(function ($s) {
|
||||
$s->key = str_replace('company.', '', $s->key);
|
||||
|
||||
return $s;
|
||||
})->pluck('value', 'key');
|
||||
|
||||
return view('settings.company.edit', compact(
|
||||
'setting'
|
||||
));
|
||||
return view('settings.company.edit');
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,6 @@ namespace App\Http\Controllers\Settings;
|
||||
use App\Abstracts\Http\Controller;
|
||||
use App\Models\Banking\Account;
|
||||
use App\Models\Setting\Currency;
|
||||
use App\Models\Setting\Setting;
|
||||
use App\Models\Setting\Tax;
|
||||
use App\Utilities\Modules;
|
||||
|
||||
@ -13,12 +12,6 @@ class Defaults extends Controller
|
||||
{
|
||||
public function edit()
|
||||
{
|
||||
$setting = Setting::prefix('default')->get()->transform(function ($s) {
|
||||
$s->key = str_replace('default.', '', $s->key);
|
||||
|
||||
return $s;
|
||||
})->pluck('value', 'key');
|
||||
|
||||
$accounts = Account::enabled()->orderBy('name')->pluck('name', 'id');
|
||||
|
||||
$currencies = Currency::enabled()->orderBy('name')->pluck('name', 'code');
|
||||
@ -28,7 +21,6 @@ class Defaults extends Controller
|
||||
$payment_methods = Modules::getPaymentMethods();
|
||||
|
||||
return view('settings.default.edit', compact(
|
||||
'setting',
|
||||
'accounts',
|
||||
'currencies',
|
||||
'taxes',
|
||||
|
@ -6,7 +6,6 @@ use App\Abstracts\Http\Controller;
|
||||
use App\Http\Requests\Setting\Setting as Request;
|
||||
use App\Models\Common\Company;
|
||||
use App\Models\Common\EmailTemplate;
|
||||
use App\Models\Setting\Setting;
|
||||
use App\Utilities\Installer;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
@ -33,12 +32,6 @@ class Email extends Controller
|
||||
|
||||
public function edit()
|
||||
{
|
||||
$setting = Setting::prefix('email')->get()->transform(function ($s) {
|
||||
$s->key = str_replace('email.', '', $s->key);
|
||||
|
||||
return $s;
|
||||
})->pluck('value', 'key');
|
||||
|
||||
$templates = EmailTemplate::all();
|
||||
|
||||
$email_protocols = [
|
||||
@ -49,7 +42,6 @@ class Email extends Controller
|
||||
];
|
||||
|
||||
return view('settings.email.edit', compact(
|
||||
'setting',
|
||||
'templates',
|
||||
'email_protocols'
|
||||
));
|
||||
|
@ -3,18 +3,11 @@
|
||||
namespace App\Http\Controllers\Settings;
|
||||
|
||||
use App\Abstracts\Http\Controller;
|
||||
use App\Models\Setting\Setting;
|
||||
|
||||
class Invoice extends Controller
|
||||
{
|
||||
public function edit()
|
||||
{
|
||||
$setting = Setting::prefix('invoice')->get()->transform(function ($s) {
|
||||
$s->key = str_replace('invoice.', '', $s->key);
|
||||
|
||||
return $s;
|
||||
})->pluck('value', 'key');
|
||||
|
||||
$item_names = [
|
||||
'settings.invoice.item' => trans('settings.invoice.item'),
|
||||
'settings.invoice.product' => trans('settings.invoice.product'),
|
||||
@ -43,7 +36,6 @@ class Invoice extends Controller
|
||||
];
|
||||
|
||||
return view('settings.invoice.edit', compact(
|
||||
'setting',
|
||||
'item_names',
|
||||
'price_names',
|
||||
'quantity_names',
|
||||
|
@ -3,7 +3,6 @@
|
||||
namespace App\Http\Controllers\Settings;
|
||||
|
||||
use App\Abstracts\Http\Controller;
|
||||
use App\Models\Setting\Setting;
|
||||
use App\Traits\DateTime;
|
||||
|
||||
class Localisation extends Controller
|
||||
@ -12,12 +11,6 @@ class Localisation extends Controller
|
||||
|
||||
public function edit()
|
||||
{
|
||||
$setting = Setting::prefix('localisation')->get()->transform(function ($s) {
|
||||
$s->key = str_replace('localisation.', '', $s->key);
|
||||
|
||||
return $s;
|
||||
})->pluck('value', 'key');
|
||||
|
||||
$timezones = $this->getTimezones();
|
||||
|
||||
$date_formats = [
|
||||
@ -49,7 +42,6 @@ class Localisation extends Controller
|
||||
];
|
||||
|
||||
return view('settings.localisation.edit', compact(
|
||||
'setting',
|
||||
'timezones',
|
||||
'date_formats',
|
||||
'date_separators',
|
||||
|
@ -3,20 +3,11 @@
|
||||
namespace App\Http\Controllers\Settings;
|
||||
|
||||
use App\Abstracts\Http\Controller;
|
||||
use App\Models\Setting\Setting;
|
||||
|
||||
class Schedule extends Controller
|
||||
{
|
||||
public function edit()
|
||||
{
|
||||
$setting = Setting::prefix('schedule')->get()->transform(function ($s) {
|
||||
$s->key = str_replace('schedule.', '', $s->key);
|
||||
|
||||
return $s;
|
||||
})->pluck('value', 'key');
|
||||
|
||||
return view('settings.schedule.edit', compact(
|
||||
'setting'
|
||||
));
|
||||
return view('settings.schedule.edit');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user