diff options
author | Mateja <mail@matejamaric.com> | 2020-11-07 01:41:03 +0100 |
---|---|---|
committer | Mateja <mail@matejamaric.com> | 2020-11-07 01:41:03 +0100 |
commit | 3ff7e365c4aedbc47d642a07181cae45269a329d (patch) | |
tree | 1a340a7b6271d1dc54b6c781ed5ca96d5f234b19 /resources/views/pages/news.blade.php | |
parent | fe6e62f3de62cde07f696738146e15af9483d8e8 (diff) | |
download | yota-laravel-3ff7e365c4aedbc47d642a07181cae45269a329d.tar.gz yota-laravel-3ff7e365c4aedbc47d642a07181cae45269a329d.zip |
Better news. I should implement url()->previous();
Gallery doesn't delete from storage...
Diffstat (limited to 'resources/views/pages/news.blade.php')
-rw-r--r-- | resources/views/pages/news.blade.php | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/resources/views/pages/news.blade.php b/resources/views/pages/news.blade.php index d700ce7..33ff039 100644 --- a/resources/views/pages/news.blade.php +++ b/resources/views/pages/news.blade.php @@ -3,14 +3,27 @@ @section('title', 'News') @section('content') - @foreach($news as $post) - <div class="card mb-3"> - <div class="card-body"> - <h2 class="card-title">{{ $post->title }}</h2> - <h6 class="card-subtitle mb-2 text-muted">Published at {{ $post->created_at->format('Y-m-d') }}@isset ($post->author) by {{$post->author }}@endisset</h4> - <div class="card-text">{!! $post->text !!}</div> + @if (session('statusE')) + <div class="alert alert-success"> + {{ session('status') }} + </div> + @endif + @if (count($news) > 0) + @foreach($news as $post) + <div class="card mb-3"> + <div class="card-body"> + <h2 class="card-title">{{ $post->title }}</h2> + <h6 class="card-subtitle mb-2 text-muted">Published at {{ $post->created_at->format('Y-m-d') }}@isset ($post->author) by {{$post->author }}@endisset</h4> + <div class="card-text">{!! $post->text !!}</div> + </div> + <div class="mt-3 card-footer"> + <a href="{{ route('newsEdit', $post->id) }}" class="btn btn-warning">Edit</a> + <a href="{{ route('newsDelete', $post->id) }}" class="float-right btn btn-danger">Delete</a> + </div> </div> - </div> - @endforeach - {{ $news->links() }} + @endforeach + {{ $news->links() }} + @else + <strong class="text-center">There are no news.</strong> + @endif @endsection() |