Get rid of unnecessary fetching of selected currency in controllers
MODIFY
app/Http/Controllers/DashboardController.php
app/Http/Controllers/DashboardController.php
@@ -9,8 +9,6 @@ use DB;
class DashboardController extends Controller {
public function __invoke() {
- $user = Auth::user();
-
$space_id = session('space')->id;
$totalEarnings = session('space')
@@ -56,8 +54,6 @@ class DashboardController extends Controller {
', [$space_id, date('m')]);
return view('dashboard', [
- 'currency' => $user->currency,
-
'recentEarnings' => $recentEarnings,
'recentSpendings' => $recentSpendings,

MODIFY
app/Http/Controllers/RecurringController.php
app/Http/Controllers/RecurringController.php
@@ -9,10 +9,7 @@ use Auth;
class RecurringController extends Controller {
public function index() {
- $user = Auth::user();
-
return view('recurrings.index', [
- 'currency' => $user->currency,
'recurrings' => session('space')->recurrings()->orderBy('created_at', 'DESC')->get()
]);
}

Get rid of unnecessary fetching of selected currency in controllers