This commit is contained in:
2025-06-07 14:54:07 +02:00
parent 6cac04fe68
commit 6136ffa5f6
3 changed files with 33 additions and 1 deletions

View File

@@ -13,7 +13,8 @@ class MangasController extends Controller
*/
public function index()
{
//
$mangas = Mangas::all();
return view("index", compact("mangas"));
}
/**

View File

@@ -0,0 +1,28 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Manga !</title>
</head>
<body>
<div id="global">
<div id="contenu">
<table>
<tr>
<th>Id</th>
<th>Titre</th>
<th>Prix</th>
<th>Couverture</th>
</tr>
@foreach($mangas as $manga)
<tr>
<td>{{ $manga->id }}</td>
<td><a href="{{ route("mangas.show", $manga->id) }}">{{ $manga->titre }}</a></td>
<td>{{ $manga->prix }}</td>
<td>{{ $manga->couverture }}</td>
</tr>
@endforeach
</table>
</div>
</div>
</body>
</html>

View File

@@ -1,7 +1,10 @@
<?php
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\MangasController;
Route::get('/', function () {
return view('welcome');
});
Route::resource("mangas", MangasController::class);