(Update) Game Character Handeling 🚀

This commit is contained in:
HDVinnie
2019-07-26 09:00:42 -04:00
parent 64d01e9e1d
commit f5db8df095
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -41,6 +41,7 @@ use Illuminate\Support\Facades\DB;
use App\Repositories\ChatRepository;
use App\Notifications\NewReseedRequest;
use MarcReichel\IGDBLaravel\Models\Game;
use MarcReichel\IGDBLaravel\Models\Character;
use App\Repositories\TorrentFacetedRepository;
use Illuminate\Pagination\LengthAwarePaginator as Paginator;
@@ -936,7 +937,7 @@ class TorrentController extends Controller
$characters = null;
if ($torrent->category->game_meta) {
$meta = Game::with(['cover' => ['url', 'image_id'], 'artworks' => ['url', 'image_id'] ,'genres' => ['name']])->find($torrent->igdb);
$characters = Game::with(['characters'])->find($torrent->igdb);
$characters = Character::whereIn('games', [$torrent->igdb])->take(6)->get();
}
if ($torrent->featured == 1) {
@@ -61,7 +61,7 @@
<div class="row cast-list">
@if ($characters)
@foreach($characters->take(6) as $character)
@foreach($characters as $character)
<div class="col-xs-4 col-md-2 text-center">
<img class="img-people" src="{{ $character->img_url }}">
<a href="https://www.themoviedb.org/person/{{ $character->id }}" title="TheMovieDatabase" target="_blank">