generated from Logisim-Evolution/Laravel-Docker
Etape 6
This commit is contained in:
@@ -13,7 +13,8 @@ class MangasController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
//
|
$mangas = Mangas::all();
|
||||||
|
return view("index", compact("mangas"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
28
laravel/resources/views/index.blade.php
Normal file
28
laravel/resources/views/index.blade.php
Normal 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>
|
||||||
@@ -1,7 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Support\Facades\Route;
|
use Illuminate\Support\Facades\Route;
|
||||||
|
use App\Http\Controllers\MangasController;
|
||||||
|
|
||||||
Route::get('/', function () {
|
Route::get('/', function () {
|
||||||
return view('welcome');
|
return view('welcome');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Route::resource("mangas", MangasController::class);
|
||||||
Reference in New Issue
Block a user