mirror of
https://github.com/BookStackApp/BookStack.git
synced 2026-10-12 02:01:37 +00:00
24 lines
536 B
PHP
24 lines
536 B
PHP
<?php
|
|
|
|
namespace BookStack\View\ViewBlocks;
|
|
|
|
use BookStack\Entities\Models\Book;
|
|
use BookStack\View\ViewBlock;
|
|
use Illuminate\Http\Request;
|
|
|
|
class BooksShowShelves extends ViewBlock
|
|
{
|
|
protected string $view = 'books.parts.show-sidebar-section-shelves';
|
|
|
|
public function withData(array $viewData, Request $request): array
|
|
{
|
|
/** @var Book $book */
|
|
$book = $viewData['book'];
|
|
$shelves = $book->shelves()->scopes('visible')->get();
|
|
|
|
return [
|
|
'shelves' => $shelves,
|
|
];
|
|
}
|
|
}
|