Get rid of search functionality
DELETE
app/Http/Controllers/SearchController.php
-<?php
-
-namespace App\Http\Controllers;
-
-use Illuminate\Http\Request;
-
-use App\Earning;
-use App\Spending;
-
-class SearchController extends Controller {
- public function index(Request $request) {
- $user = \Auth::user();
-
- $currency = $user->currency;
-
- $query = $request->get('query');
-
- $earnings = [];
-
- $spendings = [];
-
- if ($request->has('query')) {
- $earnings = Earning::where('description', 'like', '%' . $query . '%')->get();
-
- $spendings = Spending::where('description', 'like', '%' . $query . '%')->get();
- }
-
- return view('search', compact('currency', 'query', 'earnings', 'spendings'));
- }
-}

MODIFY
resources/views/layout.blade.php
resources/views/layout.blade.php
<li>
<a href="/dashboard"><i class="fa fa-home"></i> @lang('general.dashboard')</a>
</li>
- <li>
- <a href="/search"><i class="fa fa-search"></i> @lang('general.search')</a>
- </li>
<li>
<a href="/tags"><i class="fa fa-tag"></i> @lang('general.tags')</a>
</li>

DELETE
resources/views/search.blade.php
-@extends('layout')
-
-@section('body')
- <div class="wrapper spacing-top-large spacing-bottom-large">
- <form method="GET">
- <div class="row gutter">
- <div class="column">
- <input class="tight" type="text" name="query" />
- </div>
- <div class="column tight">
- <button>Search</button>
- </div>
- </div>
- </form>
- @if (!is_null($query))
- <div class="box mt-3">
- @if (!count($earnings) && !count($spendings))
- <div class="section">There were no earnings/spendings found with that search query</div>
- @endif
- @if (count($earnings))
- <ul class="section">
- @foreach ($earnings as $earning)
- <li>
- <div class="row">
- <div class="column">
- <p class="spacing-bottom-small">{{ $earning->description }}</p>
- <p>{{ date('jS', strtotime($earning->date)) }}</p>
- </div>
- <div class="column text-align-right align-middle">
- <h3>{{ $currency->symbol }} {{ $earning->amount }}</h3>
- </div>
- </div>
- </li>
- @endforeach
- </ul>
- @endif
- @if (count($spendings))
- <ul class="section">
- @foreach ($spendings as $spending)
- <li>
- <div class="row">
- <div class="column">
- <p class="spacing-bottom-small">{{ $spending->description }}</p>
- <p>{{ $spending->tag->name }} &middot; {{ date('F jS, Y', strtotime($spending->date)) }}</p>
- </div>
- <div class="column text-align-right align-middle">
- <h3>{{ $currency->symbol }} {{ $spending->amount }}</h3>
- </div>
- </div>
- </li>
- @endforeach
- </ul>
- @endif
- </div>
- @endif
- </div>
-@endsection

MODIFY
routes/web.php
routes/web.php
@@ -11,8 +11,6 @@ Route::post('/register', 'RegisterController@store');
Route::group(['middleware' => ['auth']], function () {
Route::get('/dashboard', 'DashboardController@index')->name('dashboard');
- Route::get('/search', 'SearchController@index')->name('search');
-
Route::get('/earnings/create', 'EarningsController@create')->name('earnings.create');
Route::post('/earnings', 'EarningsController@store');
Route::get('/earnings/{earning}', 'EarningsController@show')->name('earnings.show')->middleware('can:view,earning');

Get rid of search functionality