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

73 lines
1.7 KiB
PHP

<?php
namespace App\Nova\Resources;
use App\Nova\Resource;
use Laravel\Nova\Fields\ID;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Http\Requests\NovaRequest;
class NovaVisaMasterSetting extends Resource
{
/**
* The model the resource corresponds to.
*
* @var class-string<\App\Models\Resources\NovaVisaMasterSetting>
*/
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 Settings');
}
/**
* Get the displayable singular label of the resource.
*/
public static function singularLabel(): string
{
return __('Visa Master Setting');
}
/**
* 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('Name')
->rules('required', 'string', 'max:255'),
Text::make('Display name', 'display_name')
->rules('required', 'string', 'max:255'),
Text::make('Value')
->rules('required', 'string', 'max:255'),
];
}
}