Get rid of ReportsController and it's views
DELETE
app/Http/Controllers/ReportsController.php
-<?php
-
-namespace App\Http\Controllers;
-
-use Illuminate\Http\Request;
-
-use App\Earning;
-use App\Spending;
-use App\Budget;
-
-use Auth;
-
-class ReportsController extends Controller {
- public function index() {
- $user = Auth::user();
-
- $budgets = Budget::where('user_id', $user->id)
- ->groupBy('year', 'month')
- ->orderBy('year', 'DESC')
- ->orderBy('month', 'DESC')
- ->get(['id', 'year', 'month']);
-
- return view('reports.index', compact('budgets'));
- }
-
- public function show($year, $month) {
- $user = Auth::user();
-
- $currency = $user->currency;
-
- $earnings = Earning::where('user_id', $user->id)
- ->whereYear('date', $year)
- ->whereMonth('date', $month)
- ->sum('amount');
-
- $spendings = Spending::where('user_id', $user->id)
- ->whereYear('date', $year)
- ->whereMonth('date', $month)
- ->sum('amount');
-
- $budgets = Budget::where('user_id', $user->id)
- ->where('year', $year)
- ->where('month', $month)
- ->get();
-
- return view('reports.show', compact('year', 'month', 'currency', 'earnings', 'spendings', 'budgets'));
- }
-}

DELETE
resources/views/reports/index.blade.php
-@extends('layout')
-
-@section('body')
- <h1>Reports</h1>
- <p class="spacing-top-small spacing-bottom-large">Your monthly reports summarizing budgets, earnings and spendings</p>
- <div class="box">
- <table>
- <tbody>
- @foreach ($budgets as $budget)
- <tr>
- <td>
- <a href="/reports/{{ $budget->year }}/{{ $budget->month }}">@lang('months.' . $budget->month), {{ $budget->year }}<a>
- </td>
- </tr>
- @endforeach
- </tbody>
- </table>
- </div>
-@endsection

DELETE
resources/views/reports/show.blade.php
-@extends('layout')
-
-@section('body')
- <h1 class="spacing-bottom-large">Report for @lang('months.' . $month), {{ $year }}</h1>
- <div class="row">
- <div class="column">
- <div class="box spacing-large">
- <h1 class="color-green spacing-bottom-small">{{ $currency->symbol }} {{ $earnings }}</h1>
- <p>Earnings</p>
- </div>
- </div>
- <div class="column">
- <div class="box spacing-large">
- <h1 class="color-red spacing-bottom-small">{{ $currency->symbol }} {{ $spendings }}</h1>
- <p>Spendings</p>
- </div>
- </div>
- <div class="column">
- <div class="box spacing-large">
- <h1 class="color-blue spacing-bottom-small">{{ $currency->symbol }} {{ $earnings - $spendings }}</h1>
- <p>Balance</p>
- </div>
- </div>
- </div>
- <h2 class="spacing-top-large spacing-bottom-medium">Budgets</h2>
- <div class="box">
- <table>
- <tbody>
- @foreach ($budgets as $budget)
- <tr>
- <td>{{ $budget->tag->name }}</td>
- <td>{{ $currency->symbol }} {{ $budget->spendings()->sum('amount') }} of {{ $currency->symbol }} {{ $budget->amount }}</td>
- </tr>
- @endforeach
- </tbody>
- </table>
- </div>
-@endsection

MODIFY
routes/web.php
routes/web.php
@@ -19,9 +19,6 @@ Route::group(['middleware' => ['auth']], function () {
Route::resource('/tags', 'TagsController', ['only' => ['index', 'create', 'store', 'edit', 'update', 'destroy']]);
- Route::get('/reports', 'ReportsController@index')->name('reports.index');
- Route::get('/reports/{year}/{month}', 'ReportsController@show')->name('reports.show');
-
Route::get('/settings', 'SettingsController@index')->name('settings.index');
Route::post('/settings', 'SettingsController@store')->name('settings.store');
});

Get rid of ReportsController and it's views