Get rid of index view and redirect user to login or dashboard route
MODIFY
app/Http/Controllers/IndexController.php
app/Http/Controllers/IndexController.php
@@ -4,8 +4,14 @@ namespace App\Http\Controllers;
use Illuminate\Http\Request;
+use Auth;
+
class IndexController extends Controller {
public function index() {
- return view('index');
+ if (Auth::check()) {
+ return redirect()->route('dashboard');
+ }
+
+ return redirect()->route('login');
}
}

MODIFY
resources/assets/sass/app.scss
resources/assets/sass/app.scss
@@ -27,18 +27,6 @@ canvas {
width: 100%;
}
-.wallpaper {
- display: flex;
- justify-content: center;
- align-items: center;
- flex-direction: column;
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
-}
-
// Date Picker
.date-picker {
width: 352px;

DELETE
resources/views/index.blade.php
-@extends('layout')
-
-@section('body')
- <div class="wallpaper">
- <h1>Budget</h1>
- <div class="row row--gutter mt-4">
- <div class="row__column">
- <a href="/login">Log in</a>
- </div>
- <div class="row__column">
- <a href="/register">Register</a>
- </div>
- </div>
- </div>
-@endsection

Get rid of index view and redirect user to login or dashboard route