From 75de39b5ba311ef691a396e6bcb9baf618e726d7 Mon Sep 17 00:00:00 2001 From: Nurmuhammet Allanov Date: Wed, 6 Nov 2024 18:41:26 +0500 Subject: [PATCH] wip --- .../Payment/OnlinePaymentHistoryResource.php | 6 ++-- app/Repos/Payment/OnlinePaymentRepo.php | 32 +++++++++++++++++++ 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/app/Nova/Resources/Payment/OnlinePaymentHistoryResource.php b/app/Nova/Resources/Payment/OnlinePaymentHistoryResource.php index be551c1..4e37064 100644 --- a/app/Nova/Resources/Payment/OnlinePaymentHistoryResource.php +++ b/app/Nova/Resources/Payment/OnlinePaymentHistoryResource.php @@ -61,13 +61,13 @@ class OnlinePaymentHistoryResource extends Resource Text::make('Desc', 'description'), Badge::make(__('Status'), 'paymentStatus') - ->map(OrderRepo::statusClasses()) + ->map(OnlinePaymentRepo::statusClasses()) ->addTypes([ 'primary' => 'dark:bg-gray-900 bg-gray-600 text-white', ]) - ->labels(OrderRepo::statusValues()) + ->labels(OnlinePaymentRepo::statusValues()) ->withIcons() - ->icons(OrderRepo::statusIcons()) + ->icons(OnlinePaymentRepo::statusIcons()) ->sortable(), Text::make('username', 'username'), diff --git a/app/Repos/Payment/OnlinePaymentRepo.php b/app/Repos/Payment/OnlinePaymentRepo.php index 023c9a7..be2fd5b 100644 --- a/app/Repos/Payment/OnlinePaymentRepo.php +++ b/app/Repos/Payment/OnlinePaymentRepo.php @@ -41,6 +41,38 @@ class OnlinePaymentRepo ]; } + /** + * Tailwind + * + * @return array + */ + public static function statusClasses(): array + { + return [ + null => '-', + self::PENDING => 'warning', + self::PAID => 'success', + self::FAILED => 'danger', + ]; + } + + /** + * Status icons + * + * @return array + */ + public static function statusIcons(): array + { + return [ + null => '-', + 'success' => 'check-circle', + 'info' => 'information-circle', + 'primary' => 'clipboard-list', + 'danger' => 'ban', + 'warning' => 'exclamation-circle', + ]; + } + /** * Set price */