add items

This commit is contained in:
2024-11-22 21:42:38 +05:00
parent de2e8c18a4
commit 2da2d17c85
3 changed files with 113 additions and 2 deletions

View File

@@ -344,7 +344,7 @@ class NovaVisaMasterPaymentOrder extends Resource
),
]),
// HasMany::make(__('Payment items'), 'paymentItems', ),
HasMany::make(__('Payment items'), 'paymentItems', NovaVisaMasterPaymentOrderItem::class),
];
}

View File

@@ -0,0 +1,111 @@
<?php
namespace App\Modules\VisaMasterPaymentOrder\Nova\Resources;
use App\Models\Branch\Branch;
use App\Modules\VisaMasterPaymentOrder\Nova\Resources\Concerns\VisaMasterAuth;
use App\Nova\Actions\MakePaymentNovaVisaMaster;
use App\Nova\Resource;
use Illuminate\Database\Eloquent\Model;
use Laravel\Nova\Fields\ID;
use Laravel\Nova\Http\Requests\NovaRequest;
/**
* @template TModel of \App\Modules\VisaMasterPaymentOrder\Models\VisaMasterPaymentOrder
*/
class NovaVisaMasterPaymentOrderItem extends Resource
{
use VisaMasterAuth;
/**
* The model the resource corresponds to.
*
* @var class-string<\App\Modules\VisaMasterPaymentOrder\Models\VisaMasterPaymentOrder>
*/
public static $model = \App\Modules\VisaMasterPaymentOrder\Models\VisaMasterPaymentOrderItem::class;
/**
* The single value that should be used to represent the resource when being displayed.
*
* @var string
*/
public static $title = 'id';
/**
* The columns that should be searched.
*
* @var array<int, string>
*/
public static $search = [
'id',
];
/**
* The relationships that should be eager loaded on index queries.
*
* @var array
*/
// public static $with = ['branch'];
/**
* Indicates whether the resource should automatically poll for new resources.
*
* @var bool
*/
public static $polling = true;
/**
* The interval at which Nova should poll for new resources.
*
* @var int
*/
public static $pollingInterval = 30;
/**
* Indicates whether to show the polling toggle button inside Nova.
*
* @var bool
*/
public static $showPollingToggle = true;
/**
* Get the displayable label of the resource.
*/
public static function label(): string
{
return __('Payments');
}
/**
* Get the displayable singular label of the resource.
*/
public static function singularLabel(): string
{
return __('Payment');
}
/**
* Get the fields displayed by the resource.
*
* @param \Laravel\Nova\Http\Requests\NovaRequest $request
* @return array<int, \Laravel\Nova\Fields\FieldElement|\Laravel\Nova\Panel>
*/
public function fields(NovaRequest $request): array
{
return [
ID::make(),
];
}
/**
* Actions
*/
public function actions(NovaRequest $request): array
{
return [
MakePaymentNovaVisaMaster::make()
->icon('credit-card')
->sole(),
];
}
}

View File

@@ -85,7 +85,7 @@ class CheckOnlinePayment extends Action
/**
* Result html
*
* @param $response
* @param $response
*/
public function resultHTML($response)
{