Create ImportController with index function
ADD
app/Http/Controllers/ImportController.php
+<?php
+
+namespace App\Http\Controllers;
+
+use Illuminate\Http\Request;
+
+class ImportController extends Controller {
+ public function index() {
+ return view('imports.index')->with([
+ 'imports' => session('space')->imports()->orderBy('created_at', 'DESC')->get()
+ ]);
+ }
+}

MODIFY
resources/lang/dk/models.php
resources/lang/dk/models.php
@@ -12,4 +12,7 @@ return [
'spendings' => 'Udgifter',
'spending' => 'Udgift',
+
+ 'imports' => 'Imports',
+ 'import' => 'Import'
];

MODIFY
resources/lang/en/models.php
resources/lang/en/models.php
@@ -12,4 +12,7 @@ return [
'spendings' => 'Spendings',
'spending' => 'Spending',
+
+ 'imports' => 'Imports',
+ 'import' => 'Import'
];

MODIFY
resources/lang/nl/models.php
resources/lang/nl/models.php
@@ -12,4 +12,7 @@ return [
'spendings' => 'Uitgaven',
'spending' => 'Uitgave',
+
+ 'imports' => 'Imports',
+ 'import' => 'Import'
];

ADD
resources/views/imports/index.blade.php
+@extends('layout')
+
+@section('title', __('models.imports'))
+
+@section('body')
+ <div class="wrapper my-3">
+ <h2 class="mb-3">{{ __('models.imports') }}</h2>
+ <div class="box">
+ @if (count($imports))
+ <div class="box__section box__section--header row">
+ <div class="row__column">Name</div>
+ <div class="row__column">Type</div>
+ <div class="row__column">Status</div>
+ </div>
+ @foreach ($imports as $import)
+ <div class="box__section row">
+ <div class="row__column">{{ $import->name }}</div>
+ <div class="row__column">{{ $import->type }}</div>
+ <div class="row__column">{{ $import->status }}</div>
+ </div>
+ @endforeach
+ @else
+ @include('partials.empty_state', ['payload' => 'imports'])
+ @endif
+ </div>
+ </div>
+@endsection

MODIFY
resources/views/layout.blade.php
resources/views/layout.blade.php
<li>
<a href="/tags" {!! (Request::path() == 'tags') ? 'class="active"' : '' !!}><i class="far fa-tag fa-sm color-red"></i> <span class="hidden ml-05">{{ __('models.tags') }}</span></a>
</li>
+ <li>
+ <a href="/imports" {!! (Request::path() == 'imports') ? 'class="active"' : '' !!}><i class="far fa-upload fa-sm color-blue"></i> <span class="hidden ml-05">{{ __('models.imports') }}</span></a>
+ </li>
</ul>
<ul class="navigation__menu">
<li>

MODIFY
routes/web.php
routes/web.php
@@ -43,6 +43,8 @@ Route::group(['middleware' => ['auth']], function () {
'destroy'
]);
+ Route::resource('/imports', 'ImportController')->only(['index']);
+
Route::get('/settings', 'SettingsController@index')->name('settings');
Route::post('/settings', 'SettingsController@store');

Create ImportController with index function