marshmallow/nova-input-with-type

A Laravel Nova field.

Maintainers

Package info

github.com/marshmallow-packages/nova-input-with-type

pkg:composer/marshmallow/nova-input-with-type

Statistics

Installs: 3 100

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

v1.0.0 2022-12-05 16:04 UTC

This package is auto-updated.

Last update: 2026-06-11 15:52:55 UTC


README

alt text

Nova Input with Type Package

Latest Version on Packagist Total Downloads Issues License

Do you ever just wish you can set an input type for the Nova Field you are creating? You need a field with the time type but there is no package available for this. Wait no more! This extremely simple package lets you set your input type yourself.

🚨 Please make sure your browser supports the field types you are using!

Requirements

  • PHP ^7.3 or ^8.0
  • Laravel Nova

Installation

You can install the package via Composer:

composer require marshmallow/nova-input-with-type

The field is registered automatically through Laravel's package discovery (Marshmallow\InputWithType\FieldServiceProvider); no further setup is required.

Usage

You can just call the type method on your new field and nothing extra is needed:

use Marshmallow\InputWithType\InputWithType;

InputWithType::make('Started working at')->type('time'),

Methods

We've also created some alias methods for you if you don't want to use the type method. Here are some examples:

text()

InputWithType::make('My field')->text(),

color()

InputWithType::make('My field')->color(),

date()

InputWithType::make('My field')->date(),

datetimeLocal()

InputWithType::make('My field')->datetimeLocal(),

email()

InputWithType::make('My field')->email(),

hidden()

InputWithType::make('My field')->hidden(),

number()

InputWithType::make('My field')->number(),

password()

InputWithType::make('My field')->password(),

range()

InputWithType::make('My field')
    ->range()
    ->min(0)
    ->max(10)
    ->step(2),

tel()

InputWithType::make('My field')->tel(),

time()

InputWithType::make('My field')->time(),

url()

InputWithType::make('My field')->url(),

week()

InputWithType::make('My field')
    ->week()
    ->min('2018-W18')
    ->max('2018-W26'),

month()

InputWithType::make('My field')
    ->month()
    ->min('2018-03'),

search()

InputWithType::make('My field')->search(),

The min(), max() and step() helpers are passed straight through to the rendered input element, so they apply to any type that supports them (such as number, range, date, week and month).

Security

If you discover any security related issues, please email stef@marshmallow.dev instead of using the issue tracker.

Credits

License

The MIT License (MIT).