Add index function/view to TagController
MODIFY
app/Http/Controllers/TagController.php
app/Http/Controllers/TagController.php
@@ -8,6 +8,12 @@ use Auth;
use App\Tag;
class TagController extends Controller {
+ public function index() {
+ return view('tags.index', [
+ 'tags' => Auth::user()->tags()->orderBy('created_at', 'DESC')->get()
+ ]);
+ }
+
public function create() {
return view('tags.create');
}

MODIFY
resources/lang/dk/general.php
resources/lang/dk/general.php
@@ -11,6 +11,7 @@ return [
'earnings' => 'Indkomster',
'spendings' => 'Udgifter',
+ 'tags' => 'Etiketter',
'recent' => 'Seneste',

MODIFY
resources/lang/en/general.php
resources/lang/en/general.php
@@ -11,6 +11,7 @@ return [
'earnings' => 'Earnings',
'spendings' => 'Spendings',
+ 'tags' => 'Tags',
'recent' => 'Recent',

MODIFY
resources/lang/nl/general.php
resources/lang/nl/general.php
@@ -11,6 +11,7 @@ return [
'earnings' => 'Inkomsten',
'spendings' => 'Uitgaven',
+ 'tags' => 'Etiketten',
'recent' => 'Recente',

MODIFY
resources/views/layout.blade.php
resources/views/layout.blade.php
<li>
<a href="/recurrings" {!! (Request::path() == 'recurrings') ? 'class="active"' : '' !!}><i class="fas fa-recycle fa-sm mr-05"></i> {{ __('general.recurrings') }}</a>
</li>
+ <li>
+ <a href="/tags" {!! (Request::path() == 'tags') ? 'class="active"' : '' !!}><i class="fas fa-tag fa-sm mr-05"></i> {{ __('general.tags') }}</a>
+ </li>
</ul>
<ul class="navigation__menu">
<li class="dropdown">

ADD
resources/views/tags/index.blade.php
+@extends('layout')
+
+@section('body')
+ <div class="wrapper my-4">
+ <div class="color-dark mb-2">{{ __('general.tags') }}</div>
+ <div class="box">
+ @foreach ($tags as $tag)
+ <div class="box__section row">
+ <div class="row__column">{{ $tag->name }}</div>
+ <div class="row__column row__column--compact row__column--middle">
+ <a href="/tags/{{ $tag->id }}/edit">
+ <i class="far fa-pencil"></i>
+ </a>
+ </div>
+ </div>
+ @endforeach
+ </div>
+ </div>
+@endsection

MODIFY
routes/web.php
routes/web.php
@@ -24,6 +24,7 @@ Route::group(['middleware' => ['auth']], function () {
Route::resource('/recurrings', 'RecurringController')->only(['index', 'show']);
Route::resource('/tags', 'TagController')->only([
+ 'index',
'create',
'store',
'edit',

Add index function/view to TagController