44 lines
1.2 KiB
PHP
44 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Modules\VisaMasterPaymentOrder\Nova\Resources;
|
|
|
|
use App\Modules\VisaMasterPaymentOrder\Models\VisaMasterPaymentOrder;
|
|
use Ebess\AdvancedNovaMediaLibrary\Fields\Files;
|
|
|
|
class VisaMasterPaymentOrderFileFields
|
|
{
|
|
/**
|
|
* Reciver files
|
|
*
|
|
* @return array<int, \Laravel\Nova\Fields\Field>
|
|
*/
|
|
public static function reciverFiles(): array
|
|
{
|
|
return collect(VisaMasterPaymentOrder::reciverFiles())
|
|
->map(function (array $file) {
|
|
return Files::make(__($file['name']), $file['code'])
|
|
->required()
|
|
->singleMediaRules(['max:2048'])
|
|
->rules('required');
|
|
})
|
|
->toArray();
|
|
}
|
|
|
|
/**
|
|
* Sender files
|
|
*
|
|
* @return array<int, \Laravel\Nova\Fields\Field>
|
|
*/
|
|
public static function senderFiles(): array
|
|
{
|
|
return collect(VisaMasterPaymentOrder::senderFiles())
|
|
->map(function (array $file) {
|
|
return Files::make(__($file['name']), $file['code'])
|
|
->required()
|
|
->rules('required')
|
|
->singleMediaRules(['max:2048']);
|
|
})
|
|
->toArray();
|
|
}
|
|
}
|