generated from Logisim-Evolution/Laravel-Docker
Etape 7
This commit is contained in:
@@ -36,9 +36,10 @@ class MangasController extends Controller
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*/
|
||||
public function show(Mangas $mangas)
|
||||
public function show(Mangas $manga)
|
||||
{
|
||||
//
|
||||
$genre = $manga->genre;
|
||||
return view("vManga", compact("manga", "genre"));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -9,4 +9,8 @@ class Mangas extends Model
|
||||
{
|
||||
/** @use HasFactory<\Database\Factories\MangasFactory> */
|
||||
use HasFactory;
|
||||
|
||||
public function genre() {
|
||||
return $this->belongsTo(Genres::class, "genre_id");
|
||||
}
|
||||
}
|
||||
|
||||
18
laravel/resources/views/vManga.blade.php
Normal file
18
laravel/resources/views/vManga.blade.php
Normal 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>
|
||||
Reference in New Issue
Block a user