Comments + 1N relations

This commit is contained in:
Clément
2025-04-17 14:30:56 +02:00
parent ea0884d39f
commit dad50e035f
15 changed files with 380 additions and 29 deletions

View File

@@ -1,31 +1,13 @@
<!doctype html>
<html lang="fr">
<head>
<meta charset="UTF-8" />
<link rel="stylesheet" href="style.css" />
<title>Mon Blog</title>
</head>
<body>
<div id="global">
@extends('layout')
@section('contenu')
@foreach($billets as $billet)
<article>
<header>
<a href="index.php"><h1 id="titreBlog">Mon Blog</h1></a>
<p>Je vous souhaite la bienvenue sur ce modeste blog.</p>
<a href="{{ route('billets.show', $billet->id) }}"><h1 class="titreBillet">{{ $billet->BIL_TITRE }}</h1></a>
<time>{{ $billet->BIL_DATE }}</time>
</header>
<div id="contenu">
@foreach($billets as $billet)
<article>
<header>
<h1 class="titreBillet">{{ $billet->BIL_TITRE }}</h1>
<time>{{ $billet->BIL_DATE }}</time>
</header>
<p>{{ $billet->BIL_CONTENU }}</p>
</article>
<hr />
@endforeach
</div> <!-- #contenu -->
<footer id="piedBlog">
Blog réalisé avec PHP, HTML5 et CSS.
</footer>
</div> <!-- #global -->
</body>
</html>
<p>{{ $billet->BIL_CONTENU }}</p>
</article>
<hr />
@endforeach
@endsection

View File

@@ -0,0 +1,23 @@
<!doctype html>
<html lang="fr">
<head>
<meta charset="UTF-8" />
<!--link rel="stylesheet" href="style.css" /-->
<link rel="stylesheet" href="{{ URL::asset('style.css') }}" />
<title>Mon Blog</title>
</head>
<body>
<div id="global">
<header>
<a href="{{ route('billets.index') }}"><h1 id="titreBlog">Mon Blog</h1></a>
<p>Je vous souhaite la bienvenue sur ce modeste blog.</p>
</header>
<div id="contenu">
@yield('contenu')
</div> <!-- #contenu -->
<footer id="piedBlog">
Blog réalisé avec PHP, HTML5 et CSS.
</footer>
</div> <!-- #global -->
</body>
</html>

View File

@@ -0,0 +1,24 @@
@extends('layout')
@section('contenu')
<article>
<header>
<h1 class="titreBillet">{{ $billet->BIL_TITRE }}</h1>
<time>{{ $billet->BIL_DATE }}</time>
</header>
<p>{{ $billet->BIL_CONTENU }}</p>
</article>
<hr />
@if (count($commentaires) > 0)
<header>
<h1 id="titreReponses">Réponses à {{ $billet->BIL_TITRE }}</h1>
</header>
@foreach($commentaires as $commentaire)
<p>{{ $commentaire->COM_AUTEUR }} dit :</p>
<p>{{ $commentaire->COM_CONTENU }}</p>
@endforeach
@else
<header>
<h1 id="titreReponses">Il n'y a pas de réponse à ce billet.</h1>
</header>
@endif
@endsection