This commit is contained in:
2024-10-14 20:23:09 +05:00
parent c09456ec87
commit 79c6a30828
3 changed files with 121 additions and 76 deletions

View File

@@ -1,76 +0,0 @@
<?php
namespace App\Nova\Resources\OnlinePayment\History;
use App\Nova\Resource;
use Illuminate\Http\Request;
use Laravel\Nova\Fields\ID;
use Laravel\Nova\Http\Requests\NovaRequest;
class OnlinePaymentHistoryResource extends Resource
{
/**
* The model the resource corresponds to.
*
* @var class-string<\App\Models\Payment\OnlinePaymentHistory>
*/
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 [];
}
}

View File

@@ -0,0 +1,116 @@
<?php
namespace App\Nova\Resources\Payment;
use App\Nova\Resource;
use Illuminate\Http\Request;
use Laravel\Nova\Fields\DateTime;
use Laravel\Nova\Fields\ID;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Http\Requests\NovaRequest;
class OnlinePaymentHistoryResource extends Resource
{
/**
* The model the resource corresponds to.
*
* @var class-string<\App\Models\Payment\OnlinePaymentHistory>
*/
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 [];
}
}

View File

@@ -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')