$user->id]; return [ 'pages' => Page::visible()->where($createdBy)->count(), 'chapters' => Chapter::visible()->where($createdBy)->count(), 'books' => Book::visible()->where($createdBy)->count(), 'shelves' => Bookshelf::visible()->where($createdBy)->count(), ]; } }