diff --git a/app/Nova/Resources/OnlinePayment/History/OnlinePaymentHistoryResource.php b/app/Nova/Resources/OnlinePayment/History/OnlinePaymentHistoryResource.php deleted file mode 100644 index ab348f8..0000000 --- a/app/Nova/Resources/OnlinePayment/History/OnlinePaymentHistoryResource.php +++ /dev/null @@ -1,76 +0,0 @@ - - */ - public static $model = \App\Models\Payment\OnlinePaymentHistory::class; - - /** - * The single value that should be used to represent the resource when being displayed. - * - * @var string - */ - public static $title = 'orderNumber'; - - /** - * The columns that should be searched. - * - * @var array - */ - public static $search = [ - 'orderNumber', 'orderId', 'cardholderName', - ]; - - /** - * Get the fields displayed by the resource. - */ - public function fields(NovaRequest $request): array - { - return [ - ID::make()->sortable(), - ]; - } - - /** - * Get the cards available for the request. - */ - public function cards(NovaRequest $request): array - { - return []; - } - - /** - * Get the filters available for the resource. - */ - public function filters(NovaRequest $request): array - { - return []; - } - - /** - * Get the lenses available for the resource. - */ - public function lenses(NovaRequest $request): array - { - return []; - } - - /** - * Get the actions available for the resource. - */ - public function actions(NovaRequest $request): array - { - return []; - } -} diff --git a/app/Nova/Resources/Payment/OnlinePaymentHistoryResource.php b/app/Nova/Resources/Payment/OnlinePaymentHistoryResource.php new file mode 100644 index 0000000..9f50605 --- /dev/null +++ b/app/Nova/Resources/Payment/OnlinePaymentHistoryResource.php @@ -0,0 +1,116 @@ + + */ + public static $model = \App\Models\Payment\OnlinePaymentHistory::class; + + /** + * The single value that should be used to represent the resource when being displayed. + * + * @var string + */ + public static $title = 'orderId'; + + /** + * The columns that should be searched. + * + * @var array + */ + public static $search = [ + 'orderId', 'orderNumber', + ]; + + /** + * Get the displayable label of the resource. + */ + public static function label(): string + { + return __('Online payment history'); + } + + /** + * Get the fields displayed by the resource. + * + * @param \Laravel\Nova\Http\Requests\NovaRequest $request + * @return array + */ + public function fields(NovaRequest $request) + { + return [ + ID::make()->sortable(), + + Text::make('amount'), + Text::make('orderNumber'), + Text::make('description'), + Text::make('orderId'), + Text::make('formUrl'), + Text::make('successUrl'), + Text::make('paymentStatus'), + Text::make('callbackStatus'), + Text::make('username'), + Text::make('online_paymantable_id'), + Text::make('online_paymantable_type'), + + DateTime::make(__('Created at'), 'created_at'), + DateTime::make(__('Updated at'), 'updated_at'), + ]; + } + + /** + * Get the cards available for the request. + * + * @param \Laravel\Nova\Http\Requests\NovaRequest $request + * @return array + */ + public function cards(NovaRequest $request) + { + return []; + } + + /** + * Get the filters available for the resource. + * + * @param \Laravel\Nova\Http\Requests\NovaRequest $request + * @return array + */ + public function filters(NovaRequest $request) + { + return []; + } + + /** + * Get the lenses available for the resource. + * + * @param \Laravel\Nova\Http\Requests\NovaRequest $request + * @return array + */ + public function lenses(NovaRequest $request) + { + return []; + } + + /** + * Get the actions available for the resource. + * + * @param \Laravel\Nova\Http\Requests\NovaRequest $request + * @return array + */ + public function actions(NovaRequest $request) + { + return []; + } +} diff --git a/app/Repos/System/Nova/NovaMenuRepo.php b/app/Repos/System/Nova/NovaMenuRepo.php index 78e2eb0..cbe3fb9 100644 --- a/app/Repos/System/Nova/NovaMenuRepo.php +++ b/app/Repos/System/Nova/NovaMenuRepo.php @@ -17,6 +17,7 @@ use App\Nova\Resources\Order\Loan\LoanOrder; use App\Nova\Resources\Order\Loan\LoanOrderMobile; use App\Nova\Resources\Order\Loan\LoanPaidOffLetterOrder; use App\Nova\Resources\Order\Loan\LoanType; +use App\Nova\Resources\Payment\OnlinePaymentHistoryResource; use App\Nova\Resources\System\Locale\LocaleManagerResource; use App\Nova\Resources\System\Location\Province; use App\Nova\Resources\System\Roles\Permission; @@ -98,6 +99,10 @@ class NovaMenuRepo ])->icon('cog')->collapsedByDefault(), + MenuSection::resource(OnlinePaymentHistoryResource::class) + ->icon('credit-card') + ->canSee(NovaPermissionRepo::isSuperAdmin()), + MenuSection::make(__('Backups')) ->path('/backups') ->icon('server')