inspheric / nova-email-field
A Laravel Nova email field.
Fund package maintenance!
burtonsenior.com/donate/inspheric/nova-email-field
Installs: 77 597
Dependents: 1
Suggesters: 0
Security: 0
Stars: 24
Watchers: 1
Forks: 1
Open Issues: 6
Language:Vue
Requires
- php: >=7.1.0
- dev-master
- v1.42
- v1.41
- v1.4
- v1.3
- v1.2
- v1.1
- v1.0
- dev-dependabot/npm_and_yarn/ini-1.3.7
- dev-dependabot/npm_and_yarn/http-proxy-1.18.1
- dev-dependabot/npm_and_yarn/node-sass-4.14.1
- dev-dependabot/npm_and_yarn/elliptic-6.5.3
- dev-dependabot/npm_and_yarn/lodash-4.17.19
- dev-dependabot/npm_and_yarn/websocket-extensions-0.1.4
This package is auto-updated.
Last update: 2021-01-11 04:42:10 UTC
README
An email input and mailto link field for Laravel Nova
Installation
Install the package into a Laravel app that uses Nova with Composer:
composer require inspheric/nova-email-field
Usage
Add the field to your resource in the fields
method:
use Inspheric\Fields\Email; Email::make('Email') ->rules('email', /* ... */),
The field extends the Laravel\Nova\Fields\Text
field, so all the usual methods are available.
Now supports readonly, placeholder and overriding the default type="email"
if you prefer not to have the validation in the browser. This is from the standard Nova Text
field so is not documented here.
It is recommended that you include the standard email
validation rule, as it is not automatically added.
Options
Clickable
Make the field display as a mailto link on the detail page:
Email::make('Email') ->clickable(),
Clickable on Index
Make the field display as a mailto link on the index page:
Email::make('Email') ->clickableOnIndex(),
Always Clickable
Combination of the two functions above for simplicity:
Email::make('Email') ->alwaysClickable(),
Appearance
Index (default)
The field is displayed as a plain <span>
element. If the field value is blank, an em dash will be displayed.
Index (clickable)
The field is displayed as an <a href="mailto:...">
element with an icon. If the field value is blank, an em dash will be displayed instead of a link.
Detail (default)
The field is displayed as a plain <span>
element. If the field value is blank, an em dash will be displayed.
Detail (clickable)
The field is displayed as an <a href="mailto:...">
element with an icon. If the field value is blank, an em dash will be displayed instead of a link.
Form
The field is displayed as an <input type="email">
element.
Donate
💜 If you like this package, you can show your appreciation by donating any amount via PayPal to support ongoing development.