Files
online.tbbank.gov.tm-larave…/app/Nova/Resources/NovaVisaMasterSetting.php
2024-11-25 22:27:25 +05:00

71 lines
1.9 KiB
PHP

<?php
namespace App\Nova\Resources;
use App\Modules\SberPaymentOrder\Nova\Resources\Item\NovaSberPaymentOrderItemAuth;
use App\Nova\Easy\Permission\NovaEasyPermission;
use App\Nova\Resource;
use Laravel\Nova\Fields\ID;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Http\Requests\NovaRequest;
class NovaVisaMasterSetting extends Resource
{
use NovaEasyPermission;
/**
* The model the resource corresponds to.
*
* @var class-string<\App\Modules\VisaMasterSettings\Models\VisaMasterSettings>
*/
public static $model = \App\Modules\VisaMasterSettings\Models\VisaMasterSettings::class;
/**
* The single value that should be used to represent the resource when being displayed.
*
* @var string
*/
public static $title = 'name';
/**
* The columns that should be searched.
*
* @var array<int, string>
*/
public static $search = [
'name', 'value',
];
/**
* Get the displayable label of the resource.
*/
public static function label(): string
{
return __('Visa/Master, Sber Settings');
}
/**
* 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('id')->sortable(),
Text::make(__('Code'), 'name')
->rules('required', 'string', 'max:255')
->readonly(! auth()->user()->isMe()),
Text::make(__('Name'), 'display_name')
->rules('required', 'string', 'max:255')
->readonly(! auth()->user()->isMe()),
Text::make(__('Yazgy'), 'value')
->rules('required', 'string', 'max:255'),
];
}
}