mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-16 17:33:45 +00:00
Various code cleanup
This commit is contained in:
@@ -75,9 +75,9 @@ class HomeController extends Controller
|
||||
// admin notification settings:
|
||||
$notifications = [];
|
||||
foreach (config('firefly.admin_notifications') as $item) {
|
||||
$notifications[$item] = FireflyConfig::get(sprintf('notification_%s', $item), true)->data;
|
||||
$notifications[$item] = app('fireflyconfig')->get(sprintf('notification_%s', $item), true)->data;
|
||||
}
|
||||
$slackUrl = FireflyConfig::get('slack_webhook_url', '')->data;
|
||||
$slackUrl = app('fireflyconfig')->get('slack_webhook_url', '')->data;
|
||||
|
||||
return view('admin.index', compact('title', 'mainTitleIcon', 'email', 'notifications', 'slackUrl'));
|
||||
}
|
||||
@@ -94,14 +94,14 @@ class HomeController extends Controller
|
||||
if ($request->has(sprintf('notification_%s', $item))) {
|
||||
$value = true;
|
||||
}
|
||||
FireflyConfig::set(sprintf('notification_%s', $item), $value);
|
||||
app('fireflyconfig')->set(sprintf('notification_%s', $item), $value);
|
||||
}
|
||||
$url = (string)$request->get('slackUrl');
|
||||
if ('' === $url) {
|
||||
FireflyConfig::delete('slack_webhook_url');
|
||||
app('fireflyconfig')->delete('slack_webhook_url');
|
||||
}
|
||||
if (UrlValidator::isValidWebhookURL($url)) {
|
||||
FireflyConfig::set('slack_webhook_url', $url);
|
||||
app('fireflyconfig')->set('slack_webhook_url', $url);
|
||||
}
|
||||
|
||||
session()->flash('success', (string)trans('firefly.notification_settings_saved'));
|
||||
|
Reference in New Issue
Block a user