40 lines
1.0 KiB
PHP
40 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace App\Nova\Dashboards;
|
|
|
|
use App\Nova\Resources\Order\Loan\Metrics\LoanOrderPerDay;
|
|
use App\Nova\Resources\Order\Loan\Metrics\LoanOrderPerStatus;
|
|
use App\Nova\Resources\Order\Loan\Metrics\NewLoanOrders;
|
|
use Illuminate\Support\Facades\Gate;
|
|
use Laravel\Nova\Dashboards\Main as Dashboard;
|
|
|
|
class Main extends Dashboard
|
|
{
|
|
/**
|
|
* Get the displayable name of the dashboard.
|
|
*/
|
|
public function name(): string
|
|
{
|
|
return __('Homepage');
|
|
}
|
|
|
|
/**
|
|
* Get the cards for the dashboard.
|
|
*
|
|
* @return array<int, \Laravel\Nova\Card>
|
|
*/
|
|
public function cards(): array
|
|
{
|
|
return [
|
|
NewLoanOrders::make()
|
|
->canSee(fn () => Gate::allows('isAdmin', auth()->user()->isAdmin())),
|
|
|
|
LoanOrderPerDay::make()
|
|
->canSee(fn () => Gate::allows('isAdmin', auth()->user()->isAdmin())),
|
|
|
|
LoanOrderPerStatus::make()
|
|
->canSee(fn () => Gate::allows('isAdmin', auth()->user()->isAdmin())),
|
|
];
|
|
}
|
|
}
|