This commit is contained in:
2025-06-07 14:54:16 +02:00
parent 6136ffa5f6
commit 45c08b6ba9
3 changed files with 25 additions and 2 deletions

View File

@@ -36,9 +36,10 @@ class MangasController extends Controller
/** /**
* Display the specified resource. * Display the specified resource.
*/ */
public function show(Mangas $mangas) public function show(Mangas $manga)
{ {
// $genre = $manga->genre;
return view("vManga", compact("manga", "genre"));
} }
/** /**

View File

@@ -9,4 +9,8 @@ class Mangas extends Model
{ {
/** @use HasFactory<\Database\Factories\MangasFactory> */ /** @use HasFactory<\Database\Factories\MangasFactory> */
use HasFactory; use HasFactory;
public function genre() {
return $this->belongsTo(Genres::class, "genre_id");
}
} }

View File

@@ -0,0 +1,18 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Manga !</title>
</head>
<body>
<div id="global">
<div id="contenu">
<article>
<p>id : {{ $manga->id }}</p>
<p>titre : {{ $manga->titre }}</p>
<p>Genre : {{ $genre->lib_genre }}</p>
<p>Couverture : {{ $manga->couverture }}</p>
</article>
</div>
</div>
</body>
</html>