*/ public static $model = \App\Modules\Swiftpayment\Models\Swiftpayment::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 */ public static $search = [ 'id', ]; /** * Get the displayable label of the resource. */ public static function label(): string { return __('Swiftpayments'); } /** * Get the displayable singular label of the resource. */ public static function singularLabel(): string { return __('Swiftpayment'); } /** * Get the fields displayed by the resource. * * @param \Laravel\Nova\Http\Requests\NovaRequest $request * @return array */ public function fields(NovaRequest $request): array { return [ ID::make('id')->sortable(), Hidden::make('user_id')->default(auth()->id()), Select::make(__('Status'), 'status') ->displayUsingLabels() ->searchable() ->options(OrderRepo::statusValues()) ->default(OrderRepo::defaultStatus()) ->fullWidth() ->rules('required') ->canSeeWhen('systemUser', $this), Select::make(__('Ýüztutmanyň görnüşi'), 'type') ->fullWidth() ->searchable() ->rules('required') ->displayUsingLabels() ->options(ApplicationTypes::applicationTypes()), Select::make(__('Region'), 'region') ->fullWidth() ->displayUsingLabels() ->searchable() ->options(RegionRepo::values()) ->default(RegionRepo::default()) ->rules('required') ->sortable(), Select::make(__('Branch'), 'branch_id') ->fullWidth() ->displayUsingLabels() ->searchable() ->dependsOn('region', NovaRepo::dependsOnRegion('region', Branch::class)) ->rules('required') ->sortable(), Text::make('Pasportdaky ady', 'passport_name') ->fullWidth() ->rules('required', 'string', 'max:255'), Text::make('Pasportdaky familiýa', 'passport_surname') ->fullWidth() ->rules('required', 'string', 'max:255'), NovaInputmask::make('Telefon belgi', 'phone') ->fullWidth() ->phonenumber('TM') ->rules('required', 'max:255') ->hideFromIndex(), Text::make('Email', 'email') ->fullWidth() ->rules('required', 'max:255', 'email') ->hideFromIndex(), Text::make('Ýaşaýan ýeriň salgysy', 'address') ->fullWidth() ->rules('required', 'string', 'max:255') ->hideFromIndex(), SimpleRepeatable::make('Tölegi ugradyjynyň maglumatlar', 'sender_datas', [ Select::make(__('Passport serie'), 'passport_serie') ->displayUsingLabels() ->searchable() ->options(PassportRepo::values()) ->rules('required') ->sortable(), NovaInputmask::make('Passport nomeri') ->mask('999999') ->rules('required', 'max:255'), Text::make('A.F.AA'), ])->minRows(1)->rules('required'), SimpleRepeatable::make('Tölegi kabul edijiniň maglumatlary', 'payment_reciever', [ Select::make(__('Passport serie'), 'passport_serie') ->displayUsingLabels() ->searchable() ->options(PassportRepo::values()) ->rules('required') ->sortable(), NovaInputmask::make('Passport nomeri') ->mask('999999') ->rules('required', 'max:255'), Text::make('A.F.AA'), ])->maxRows(1)->rules('required'), Files::make('Talap edilýän resminamalar', 'main') ->conversionOnIndexView('thumb') ->rules('required') ->hideFromIndex(), Badge::make(__('Status'), 'status') ->map(OrderRepo::statusClasses()) ->addTypes([ 'primary' => 'dark:bg-gray-900 bg-gray-600 text-white', ]) ->labels(OrderRepo::statusValues()) ->withIcons() ->icons(OrderRepo::statusIcons()), Trix::make(__('Notes'), 'notes') ->hideWhenCreating() ->alwaysShow() ->readonly(function ($request) { return ! $request->user()->hasRole(['admin', 'manager', 'operator']); }), ]; } }