diff --git a/app/Nova/Resources/Payment/OnlinePaymentHistoryResource.php b/app/Nova/Resources/Payment/OnlinePaymentHistoryResource.php index 9fba82a..be551c1 100644 --- a/app/Nova/Resources/Payment/OnlinePaymentHistoryResource.php +++ b/app/Nova/Resources/Payment/OnlinePaymentHistoryResource.php @@ -5,10 +5,12 @@ namespace App\Nova\Resources\Payment; use App\Nova\Actions\CheckOnlinePayment; use App\Nova\Resource; use App\Repos\Order\OrderRepo; +use App\Repos\Payment\OnlinePaymentRepo; use Illuminate\Http\Request; use Laravel\Nova\Fields\Badge; use Laravel\Nova\Fields\DateTime; use Laravel\Nova\Fields\ID; +use Laravel\Nova\Fields\Select; use Laravel\Nova\Fields\Text; use Laravel\Nova\Http\Requests\NovaRequest; @@ -48,7 +50,7 @@ class OnlinePaymentHistoryResource extends Resource /** * Fields for index * - * @param NovaRequest $request + * @param NovaRequest $request */ public function fieldsForIndex(NovaRequest $request) { @@ -92,7 +94,14 @@ class OnlinePaymentHistoryResource extends Resource Text::make('orderId', 'orderId'), Text::make('formUrl', 'formUrl'), Text::make('successUrl', 'successUrl'), - Text::make('paymentStatus', 'paymentStatus'), + + Select::make(__('Status'), 'paymentStatus') + ->displayUsingLabels() + ->searchable() + ->options(OnlinePaymentRepo::statusValues()) + ->fullWidth() + ->filterable(), + Text::make('callbackStatus', 'callbackStatus'), Text::make('username'), Text::make('online_paymantable_id'), diff --git a/app/Repos/Payment/OnlinePaymentRepo.php b/app/Repos/Payment/OnlinePaymentRepo.php index 3ad187e..023c9a7 100644 --- a/app/Repos/Payment/OnlinePaymentRepo.php +++ b/app/Repos/Payment/OnlinePaymentRepo.php @@ -26,6 +26,21 @@ class OnlinePaymentRepo */ public const PAID = 'paid'; + /** + * Status Values + * + * @return array + */ + public static function statusValues(): array + { + return [ + null => '-', + self::PENDING => __('Pending'), + self::PAID => __('Paid'), + self::FAILED => __('Cancelled'), + ]; + } + /** * Set price */