Add 404 view
MODIFY
app/Http/Controllers/SpendingsController.php
app/Http/Controllers/SpendingsController.php
@@ -42,9 +42,13 @@ class SpendingsController extends Controller {
$spending = Spending::find($id);
+ if ($spending->user_id === $user->id) {
return view('spendings.show', compact('currency', 'spending'));
}
+ return view('errors.404');
+ }
+
public function destroy($id) {
$spending = Spending::find($id);

ADD
resources/views/errors/404.blade.php
+@extends('layout')
+
+@section('body')
+ <div class="wrapper narrow spacing-top-large spacing-bottom-large">
+ <div class="box">
+ <div class="section">
+ <h3 class="text-align-center">404</h3>
+ </div>
+ </div>
+ </div>
+@endsection

Add 404 view