@extends('layouts.app') @section('content')

All Books

Reset
@if($books->count() === 0)
No books found.
@else
@foreach($books as $book)
@if($book->cover_image) {{ $book->title }} cover @else
No Cover
@endif

{{ $book->title }}

@if($book->authors && $book->authors->count()) {{ $book->authors->pluck('name')->join(', ') }} @elseif($book->author) {{ $book->author }} @endif

@if($book->category)

Category: {{ $book->category->name }}

@endif @auth
@php($inReadlist = auth()->user()->readlistBooks()->where('book_id', $book->id)->exists()) @if(!$inReadlist)
@csrf
@else
@csrf @method('DELETE')
@endif
@endauth
@endforeach
{{ $books->links() }}
@endif @endsection