Disable button for deleting resource on tags' index view if it has any spendings related
MODIFY
resources/views/tags/index.blade.php
resources/views/tags/index.blade.php
</a>
</div>
<div class="row__column row__column--compact ml-2">
+ @if ($tag->spendings->count())
+ <i class="far fa-trash-alt"></i>
+ @else
<form method="POST" action="/tags/{{ $tag->id }}">
{{ method_field('DELETE') }}
{{ csrf_field() }}
<i class="far fa-trash-alt"></i>
</button>
</form>
+ @endif
</div>
</div>
</div>

Disable button for deleting resource on tags' index view if it has any spendings related