*/ public static $model = OrderShippingMethodModel::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 */ public static $search = [ 'id', 'name', 'slug', ]; /** * Get the displayable label of the resource. */ public static function label(): string { return __('Shipping methods'); } /** * Get the displayable singular label of the resource. */ public static function singularLabel(): string { return __('Shipping method'); } /** * Get the fields displayed by the resource. */ public function fields(NovaRequest $request): array { return [ ID::make()->sortable(), Text::make(__('Name'), 'name') ->translatable() ->rules('required', 'max:255'), Text::make(__('Slug'), 'slug') ->hideWhenCreating() ->hideWhenUpdating() ->rules('nullable', 'string', 'max:255'), Textarea::make(__('Description'), 'description') ->translatable() ->rules('nullable', 'max:1000'), Number::make(__('Price'), 'price') ->step(0.01) ->rules('required', 'numeric', 'min:0'), NovaSwitcher::make(__('Is active'), 'is_active') ->default(true), ]; } }