Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Ep#15: Blade components
  • Loading branch information
arifktk32 committed Dec 6, 2021
1 parent 9c5474d commit 7534547
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 28 deletions.
Expand Up @@ -5,6 +5,6 @@
<link href="/app.css" rel="stylesheet" />
</head>
<body>
@yield('content')
{{ $slot }}
</body>
</html>
20 changes: 9 additions & 11 deletions resources/views/post.blade.php
@@ -1,12 +1,10 @@
@extends('layout')
<x-layout>
<article>
<h1>{{ $post->title }}</h1>

@section('content')
<article>
<h1>{{ $post->title }}</h1>

<div>
{!! $post->body !!}
</div>
</article>
<a href="/">Go Back</a>
@endsection
<div>
{!! $post->body !!}
</div>
</article>
<a href="/">Go Back</a>
</x-layout>
28 changes: 12 additions & 16 deletions resources/views/posts.blade.php
@@ -1,16 +1,12 @@
@extends('layout');

@section('content')

@foreach($posts as $post)
<article>
<h1>
<a href="/posts/{{ $post->slug }}">
{{ $post->title }}
</a>
</h1>
<p>{{ $post->excerpt }}</p>
</article>
@endforeach

@endsection
<x-layout>
@foreach($posts as $post)
<article>
<h1>
<a href="/posts/{{ $post->slug }}">
{{ $post->title }}
</a>
</h1>
<p>{{ $post->excerpt }}</p>
</article>
@endforeach
</x-layout>

0 comments on commit 7534547

Please sign in to comment.