Skip to content

Commit

Permalink
Merge pull request #10 from Saifallak/patch-1
Browse files Browse the repository at this point in the history
use `getEloquentQuery()` instead of `getModel()`
  • Loading branch information
awcodes authored Apr 28, 2023
2 parents 00638b9 + 408c5e6 commit 8e57e75
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Overlook.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,11 @@ public function getData(): array
return ! in_array($resource, $this->getExcludes());
})->transform(function ($resource) {
$res = app($resource);
$model = $res->getModel();

if ($res->canViewAny()) {
return [
'name' => ucfirst($res->getPluralModelLabel()),
'count' => $model::count(),
'count' => $res::getEloquentQuery()->count(),
'icon' => invade($res)->getNavigationIcon(),
'url' => $res->getUrl('index'),
];
Expand Down

0 comments on commit 8e57e75

Please sign in to comment.