update: mediahub genres

This commit is contained in:
HDVinnie
2023-02-13 06:51:03 -05:00
parent a03f2ee7eb
commit d18aee6837
2 changed files with 3 additions and 5 deletions
@@ -23,7 +23,7 @@ class GenreController extends Controller
*/
public function index(): \Illuminate\Contracts\View\Factory|\Illuminate\View\View
{
$genres = Genre::paginate(25);
$genres = Genre::withCount(['tv', 'movie'])->orderBy('name')->get();
return view('mediahub.genre.index', ['genres' => $genres]);
}
@@ -22,7 +22,6 @@
@section('content')
<section class="panelV2">
<h2 class="panel__heading">{{ __('common.genres') }}</h2>
{{ $genres->links('partials.pagination') }}
<div class="panel__body blocks">
@foreach ($genres as $genre)
<a href="{{ route('mediahub.genres.show', ['id' => $genre->id]) }}" style="padding: 0 2px;">
@@ -30,14 +29,13 @@
<h2 class="text-bold"> {{ $genre->name }}</h2>
<span style="background-color: #317aaf;"></span>
<h2 style="font-size: 14px;">
<i class="{{ config('other.font-awesome') }} fa-tv-retro"></i> {{ $genre->tv->count() }} {{ __('mediahub.shows') }}
<i class="{{ config('other.font-awesome') }} fa-tv-retro"></i> {{ $genre->tv_count }} {{ __('mediahub.shows') }}
|
<i class="{{ config('other.font-awesome') }} fa-film"></i> {{ $genre->movie->count() }} {{ __('mediahub.movies') }}
<i class="{{ config('other.font-awesome') }} fa-film"></i> {{ $genre->movie_count }} {{ __('mediahub.movies') }}
</h2>
</div>
</a>
@endforeach
</div>
{{ $genres->links('partials.pagination') }}
</section>
@endsection