Skip to content

Commit

Permalink
Minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
austintoddj committed Nov 1, 2018
1 parent 2ecb681 commit 3d99a7a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
7 changes: 2 additions & 5 deletions resources/views/blog/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,12 @@
<div class="container">
<div class="row justify-content-md-center">
<div class="col col-lg-8">
<h2 class="mb-5">@isset($data['tag']) {{ $data['tag'] }} @else Blog @endisset</h2>
@if(count($data['posts']) > 0)
@foreach($data['posts'] as $post)
<p class="lead"><a href="{{ route('blog.post.show', $post->slug) }}">{{ $post->title }}</a></p>
<p class="small text-muted">Published on {{ \Carbon\Carbon::parse($post->published_at)->format('M d, Y') }}</p>
<p>{{ $post->summary }}</p>
@if($post->tags->count() > 0)
@foreach($post->tags as $tag)
<p><a href="{{ route('blog.tag.show', $tag->slug) }}" class="badge badge-pill badge-primary">{{ $tag->name }}</a></p>
@endforeach
@endif
<hr>
@endforeach
@else
Expand Down
8 changes: 5 additions & 3 deletions resources/views/blog/show.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
<div class="container">
<div class="row justify-content-md-center">
<div class="col col-lg-8">
<h1>{{ $data['post']->title }}</h1>
<p class="small text-muted">Published {{ \Carbon\Carbon::parse($data['post']->published_at)->format('M d, Y') }} by <strong>{{ $data['user']->name }}</strong></p>
<h2>{{ $data['post']->title }}</h2>
<p class="small text-muted">Published on {{ \Carbon\Carbon::parse($data['post']->published_at)->format('M d, Y') }} by {{ $data['user']->name }}</p>
@if($data['post']->tags->count() > 0)
@foreach($data['post']->tags as $tag)
<p><a href="{{ route('blog.tag.show', $tag->slug) }}" class="badge badge-pill badge-primary">{{ $tag->name }}</a></p>
<p><a href="{{ route('blog.tag.index', $tag->slug) }}"
class="badge badge-pill badge-primary">{{ $tag->name }}</a></p>
@endforeach
@endif
<hr>
<p>{{ $data['post']->body }}</p>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion routes/blog.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
// Blog Routes...
Route::get('/', 'BlogController@index')->name('blog.index');
Route::get('/{post}', 'PostController@show')->name('blog.post.show');
Route::get('/tag/{tag}', 'TagController@show')->name('blog.tag.show');
Route::get('/tag/{tag}', 'TagController@index')->name('blog.tag.index');

0 comments on commit 3d99a7a

Please sign in to comment.