diff --git a/app/Http/Controllers/Account/ReconcileController.php b/app/Http/Controllers/Account/ReconcileController.php index d4b5a0dc60..d8fd0cd6c3 100644 --- a/app/Http/Controllers/Account/ReconcileController.php +++ b/app/Http/Controllers/Account/ReconcileController.php @@ -106,7 +106,7 @@ class ReconcileController extends Controller if (true !== session('reconcile.edit.fromUpdate')) { $this->rememberPreviousUri('reconcile.edit.uri'); } - Session::forget('reconcile.edit.fromUpdate'); + session()->forget('reconcile.edit.fromUpdate'); return view( 'accounts.reconcile.edit', @@ -444,7 +444,7 @@ class ReconcileController extends Controller // @codeCoverageIgnoreStart if (1 === (int)$request->get('return_to_edit')) { - Session::put('reconcile.edit.fromUpdate', true); + session()->put('reconcile.edit.fromUpdate', true); return redirect(route('accounts.reconcile.edit', [$journal->id]))->withInput(['return_to_edit' => 1]); } diff --git a/app/Http/Controllers/Admin/UserController.php b/app/Http/Controllers/Admin/UserController.php index 52668c09ad..0f514dc232 100644 --- a/app/Http/Controllers/Admin/UserController.php +++ b/app/Http/Controllers/Admin/UserController.php @@ -94,7 +94,7 @@ class UserController extends Controller if (true !== session('users.edit.fromUpdate')) { $this->rememberPreviousUri('users.edit.uri'); } - Session::forget('users.edit.fromUpdate'); + session()->forget('users.edit.fromUpdate'); $subTitle = (string)trans('firefly.edit_user', ['email' => $user->email]); $subTitleIcon = 'fa-user-o'; @@ -187,7 +187,7 @@ class UserController extends Controller if (1 === (int)$request->get('return_to_edit')) { // @codeCoverageIgnoreStart - Session::put('users.edit.fromUpdate', true); + session()->put('users.edit.fromUpdate', true); return redirect(route('admin.users.edit', [$user->id]))->withInput(['return_to_edit' => 1]); // @codeCoverageIgnoreEnd diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index 8cb0036c5d..ec49442c69 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -174,6 +174,6 @@ class Controller extends BaseController */ protected function rememberPreviousUri(string $identifier) { - Session::put($identifier, URL::previous()); + session()->put($identifier, URL::previous()); } } diff --git a/app/Http/Controllers/PiggyBankController.php b/app/Http/Controllers/PiggyBankController.php index 2ada211d3a..1e34577ae1 100644 --- a/app/Http/Controllers/PiggyBankController.php +++ b/app/Http/Controllers/PiggyBankController.php @@ -137,7 +137,7 @@ class PiggyBankController extends Controller if (true !== session('piggy-banks.create.fromStore')) { $this->rememberPreviousUri('piggy-banks.create.uri'); } - Session::forget('piggy-banks.create.fromStore'); + session()->forget('piggy-banks.create.fromStore'); return view('piggy-banks.create', compact('subTitle', 'subTitleIcon')); } @@ -204,7 +204,7 @@ class PiggyBankController extends Controller if (true !== session('piggy-banks.edit.fromUpdate')) { $this->rememberPreviousUri('piggy-banks.edit.uri'); } - Session::forget('piggy-banks.edit.fromUpdate'); + session()->forget('piggy-banks.edit.fromUpdate'); return view('piggy-banks.edit', compact('subTitle', 'subTitleIcon', 'piggyBank', 'preFilled')); } @@ -435,7 +435,7 @@ class PiggyBankController extends Controller if (1 === (int)$request->get('create_another')) { // @codeCoverageIgnoreStart - Session::put('piggy-banks.create.fromStore', true); + session()->put('piggy-banks.create.fromStore', true); return redirect(route('piggy-banks.create'))->withInput(); // @codeCoverageIgnoreEnd @@ -460,7 +460,7 @@ class PiggyBankController extends Controller if (1 === (int)$request->get('return_to_edit')) { // @codeCoverageIgnoreStart - Session::put('piggy-banks.edit.fromUpdate', true); + session()->put('piggy-banks.edit.fromUpdate', true); return redirect(route('piggy-banks.edit', [$piggyBank->id])); // @codeCoverageIgnoreEnd diff --git a/app/Http/Controllers/PreferencesController.php b/app/Http/Controllers/PreferencesController.php index 6e66ed4ab9..2a2dedfe55 100644 --- a/app/Http/Controllers/PreferencesController.php +++ b/app/Http/Controllers/PreferencesController.php @@ -105,9 +105,9 @@ class PreferencesController extends Controller // view range: Preferences::set('viewRange', $request->get('viewRange')); // forget session values: - Session::forget('start'); - Session::forget('end'); - Session::forget('range'); + session()->forget('start'); + session()->forget('end'); + session()->forget('range'); // custom fiscal year $customFiscalYear = 1 === (int)$request->get('customFiscalYear'); diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php index 51d0a377e1..dc2f2cdd3a 100644 --- a/app/Http/Controllers/ProfileController.php +++ b/app/Http/Controllers/ProfileController.php @@ -307,7 +307,7 @@ class ProfileController extends Controller public function postCode(TokenFormRequest $request) { Preferences::set('twoFactorAuthEnabled', 1); - Preferences::set('twoFactorAuthSecret', Session::get('two-factor-secret')); + Preferences::set('twoFactorAuthSecret', session()->get('two-factor-secret')); session()->flash('success', (string)trans('firefly.saved_preferences')); Preferences::mark(); @@ -332,7 +332,7 @@ class ProfileController extends Controller Log::info(sprintf('User #%d has opted to delete their account', auth()->user()->id)); // make repository delete user: auth()->logout(); - Session::flush(); + session()->flush(); $repository->destroy($user); return redirect(route('index')); diff --git a/app/Http/Controllers/RuleController.php b/app/Http/Controllers/RuleController.php index dce7622951..55eed182cb 100644 --- a/app/Http/Controllers/RuleController.php +++ b/app/Http/Controllers/RuleController.php @@ -146,7 +146,7 @@ class RuleController extends Controller if (true !== session('rules.create.fromStore')) { $this->rememberPreviousUri('rules.create.uri'); } - Session::forget('rules.create.fromStore'); + session()->forget('rules.create.fromStore'); return view( 'rules.rule.create', @@ -242,7 +242,7 @@ class RuleController extends Controller if (true !== session('rules.edit.fromUpdate')) { $this->rememberPreviousUri('rules.edit.uri'); } - Session::forget('rules.edit.fromUpdate'); + session()->forget('rules.edit.fromUpdate'); return view('rules.rule.edit', compact('rule', 'subTitle', 'primaryTrigger', 'oldTriggers', 'oldActions', 'triggerCount', 'actionCount', 'ruleGroups')); } @@ -370,7 +370,7 @@ class RuleController extends Controller if (1 === (int)$request->get('create_another')) { // @codeCoverageIgnoreStart - Session::put('rules.create.fromStore', true); + session()->put('rules.create.fromStore', true); return redirect(route('rules.create', [$data['rule_group_id']]))->withInput(); // @codeCoverageIgnoreEnd @@ -522,7 +522,7 @@ class RuleController extends Controller if (1 === (int)$request->get('return_to_edit')) { // @codeCoverageIgnoreStart - Session::put('rules.edit.fromUpdate', true); + session()->put('rules.edit.fromUpdate', true); return redirect(route('rules.edit', [$rule->id]))->withInput(['return_to_edit' => 1]); // @codeCoverageIgnoreEnd diff --git a/app/Http/Controllers/RuleGroupController.php b/app/Http/Controllers/RuleGroupController.php index 2d139e9361..0f91704347 100644 --- a/app/Http/Controllers/RuleGroupController.php +++ b/app/Http/Controllers/RuleGroupController.php @@ -70,7 +70,7 @@ class RuleGroupController extends Controller if (true !== session('rule-groups.create.fromStore')) { $this->rememberPreviousUri('rule-groups.create.uri'); } - Session::forget('rule-groups.create.fromStore'); + session()->forget('rule-groups.create.fromStore'); return view('rules.rule-group.create', compact('subTitleIcon', 'subTitle')); } @@ -140,7 +140,7 @@ class RuleGroupController extends Controller if (true !== session('rule-groups.edit.fromUpdate')) { $this->rememberPreviousUri('rule-groups.edit.uri'); } - Session::forget('rule-groups.edit.fromUpdate'); + session()->forget('rule-groups.edit.fromUpdate'); return view('rules.rule-group.edit', compact('ruleGroup', 'subTitle')); } @@ -214,7 +214,7 @@ class RuleGroupController extends Controller if (1 === (int)$request->get('create_another')) { // @codeCoverageIgnoreStart - Session::put('rule-groups.create.fromStore', true); + session()->put('rule-groups.create.fromStore', true); return redirect(route('rule-groups.create'))->withInput(); // @codeCoverageIgnoreEnd @@ -258,7 +258,7 @@ class RuleGroupController extends Controller if (1 === (int)$request->get('return_to_edit')) { // @codeCoverageIgnoreStart - Session::put('rule-groups.edit.fromUpdate', true); + session()->put('rule-groups.edit.fromUpdate', true); return redirect(route('rule-groups.edit', [$ruleGroup->id]))->withInput(['return_to_edit' => 1]); // @codeCoverageIgnoreEnd diff --git a/app/Http/Controllers/TagController.php b/app/Http/Controllers/TagController.php index ffc0e7a838..0a67591875 100644 --- a/app/Http/Controllers/TagController.php +++ b/app/Http/Controllers/TagController.php @@ -86,7 +86,7 @@ class TagController extends Controller if (true !== session('tags.create.fromStore')) { $this->rememberPreviousUri('tags.create.uri'); } - Session::forget('tags.create.fromStore'); + session()->forget('tags.create.fromStore'); return view('tags.create', compact('subTitle', 'subTitleIcon', 'apiKey')); } @@ -141,7 +141,7 @@ class TagController extends Controller if (true !== session('tags.edit.fromUpdate')) { $this->rememberPreviousUri('tags.edit.uri'); } - Session::forget('tags.edit.fromUpdate'); + session()->forget('tags.edit.fromUpdate'); return view('tags.edit', compact('tag', 'subTitle', 'subTitleIcon', 'apiKey')); } @@ -266,7 +266,7 @@ class TagController extends Controller if (1 === (int)$request->get('create_another')) { // @codeCoverageIgnoreStart - Session::put('tags.create.fromStore', true); + session()->put('tags.create.fromStore', true); return redirect(route('tags.create'))->withInput(); // @codeCoverageIgnoreEnd @@ -291,7 +291,7 @@ class TagController extends Controller if (1 === (int)$request->get('return_to_edit')) { // @codeCoverageIgnoreStart - Session::put('tags.edit.fromUpdate', true); + session()->put('tags.edit.fromUpdate', true); return redirect(route('tags.edit', [$tag->id]))->withInput(['return_to_edit' => 1]); // @codeCoverageIgnoreEnd diff --git a/app/Http/Controllers/Transaction/BulkController.php b/app/Http/Controllers/Transaction/BulkController.php index ab1dd5f0f7..72e807051c 100644 --- a/app/Http/Controllers/Transaction/BulkController.php +++ b/app/Http/Controllers/Transaction/BulkController.php @@ -30,8 +30,6 @@ use FireflyIII\Http\Requests\BulkEditJournalRequest; use FireflyIII\Models\TransactionJournal; use FireflyIII\Repositories\Budget\BudgetRepositoryInterface; use FireflyIII\Repositories\Journal\JournalRepositoryInterface; -use FireflyIII\Services\Internal\Update\JournalUpdateService; -use Illuminate\Http\Request; use Illuminate\Support\Collection; use Log; use Preferences; diff --git a/app/Http/Controllers/Transaction/SingleController.php b/app/Http/Controllers/Transaction/SingleController.php index e722a33bd3..3ef98a6fd4 100644 --- a/app/Http/Controllers/Transaction/SingleController.php +++ b/app/Http/Controllers/Transaction/SingleController.php @@ -158,7 +158,7 @@ class SingleController extends Controller $budgets = ExpandedForm::makeSelectListWithEmpty($this->budgets->getActiveBudgets()); $piggyBanks = $this->piggyBanks->getPiggyBanksWithAmount(); $piggies = ExpandedForm::makeSelectListWithEmpty($piggyBanks); - $preFilled = Session::has('preFilled') ? session('preFilled') : []; + $preFilled = session()->has('preFilled') ? session('preFilled') : []; $subTitle = trans('form.add_new_' . $what); $subTitleIcon = 'fa-plus'; $optionalFields = Preferences::get('transaction_journal_optional_fields', [])->data; @@ -171,13 +171,13 @@ class SingleController extends Controller $preFilled['destination_account_id'] = $source; } - Session::put('preFilled', $preFilled); + session()->put('preFilled', $preFilled); // put previous url in session if not redirect from store (not "create another"). if (true !== session('transactions.create.fromStore')) { $this->rememberPreviousUri('transactions.create.uri'); } - Session::forget('transactions.create.fromStore'); + session()->forget('transactions.create.fromStore'); asort($piggies); @@ -318,7 +318,7 @@ class SingleController extends Controller if (true !== session('transactions.edit.fromUpdate')) { $this->rememberPreviousUri('transactions.edit.uri'); } - Session::forget('transactions.edit.fromUpdate'); + session()->forget('transactions.edit.fromUpdate'); return view( 'transactions.single.edit', @@ -369,7 +369,7 @@ class SingleController extends Controller // @codeCoverageIgnoreStart if (true === $createAnother) { - Session::put('transactions.create.fromStore', true); + session()->put('transactions.create.fromStore', true); return redirect(route('transactions.create', [$request->input('what')]))->withInput(); } @@ -426,7 +426,7 @@ class SingleController extends Controller // @codeCoverageIgnoreStart if (1 === (int)$request->get('return_to_edit')) { - Session::put('transactions.edit.fromUpdate', true); + session()->put('transactions.edit.fromUpdate', true); return redirect(route('transactions.edit', [$journal->id]))->withInput(['return_to_edit' => 1]); } diff --git a/app/Http/Controllers/Transaction/SplitController.php b/app/Http/Controllers/Transaction/SplitController.php index b574015d42..936b5cf15b 100644 --- a/app/Http/Controllers/Transaction/SplitController.php +++ b/app/Http/Controllers/Transaction/SplitController.php @@ -122,7 +122,7 @@ class SplitController extends Controller if (true !== session('transactions.edit-split.fromUpdate')) { $this->rememberPreviousUri('transactions.edit-split.uri'); } - Session::forget('transactions.edit-split.fromUpdate'); + session()->forget('transactions.edit-split.fromUpdate'); return view( 'transactions.split.edit', compact( @@ -170,7 +170,7 @@ class SplitController extends Controller // @codeCoverageIgnoreStart if (1 === (int)$request->get('return_to_edit')) { // set value so edit routine will not overwrite URL: - Session::put('transactions.edit-split.fromUpdate', true); + session()->put('transactions.edit-split.fromUpdate', true); return redirect(route('transactions.split.edit', [$journal->id]))->withInput(['return_to_edit' => 1]); }