This commit is contained in:
nurmuhammet committed 2023-12-04 18:41:36 +05:00
1 parent af512688bc
commit a3d41770e7
3 files changed
+10 -15

No files matched your search

+10 -3
View File
@@ -5,6 +5,7 @@
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
@@ -23,9 +24,15 @@ public function name(): string
public function cards(): array
{
return [
NewLoanOrders::make(),
LoanOrderPerDay::make(),
LoanOrderPerStatus::make(),
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())),
];
}
}
@@ -19,9 +19,6 @@ public function name(): string
/**
* Calculate the value of the metric.
*
* @param \Laravel\Nova\Http\Requests\NovaRequest $request
* @return mixed
*/
public function calculate(NovaRequest $request): mixed
{
@@ -30,8 +27,6 @@ public function calculate(NovaRequest $request): mixed
/**
* Get the ranges available for the metric.
*
* @return array
*/
public function ranges(): array
{
@@ -54,8 +49,6 @@ public function cacheFor()
/**
* Get the URI key for the metric.
*
* @return string
*/
public function uriKey(): string
{
@@ -19,9 +19,6 @@ public function name(): string
/**
* Calculate the value of the metric.
*
* @param \Laravel\Nova\Http\Requests\NovaRequest $request
* @return mixed
*/
public function calculate(NovaRequest $request): mixed
{
@@ -45,8 +42,6 @@ public function cacheFor()
/**
* Get the URI key for the metric.
*
* @return string
*/
public function uriKey(): string
{