PHPackages                             waynestate/nova-text-copy-field - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. waynestate/nova-text-copy-field

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

waynestate/nova-text-copy-field
===============================

Laravel Nova text field with click to copy support

v3.0.0(1y ago)1118.1k↑15.8%1MITVuePHP &gt;=8.1

Since Oct 9Pushed 1y ago3 watchersCompare

[ Source](https://github.com/waynestate/nova-text-copy-field)[ Packagist](https://packagist.org/packages/waynestate/nova-text-copy-field)[ Docs](https://github.com/waynestate/nova-text-copy-field)[ RSS](/packages/waynestate-nova-text-copy-field/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (8)Dependencies (1)Versions (18)Used By (0)

Nova Text Copy Field
====================

[](#nova-text-copy-field)

[![Latest Stable Version](https://camo.githubusercontent.com/f2761a5d309cd5edb700c862b1c4cfb9485c62255548fb3d124c273c7b49422d/687474703a2f2f706f7365722e707567782e6f72672f7761796e6573746174652f6e6f76612d746578742d636f70792d6669656c642f76)](https://packagist.org/packages/waynestate/nova-text-copy-field) [![Total Downloads](https://camo.githubusercontent.com/fc06ca2704036b9bccc25b3de1575f5a091eaca96f664b66dcf38abfbc9d0927/687474703a2f2f706f7365722e707567782e6f72672f7761796e6573746174652f6e6f76612d746578742d636f70792d6669656c642f646f776e6c6f616473)](https://packagist.org/packages/waynestate/nova-text-copy-field) [![License](https://camo.githubusercontent.com/a6a90da10df5728ffbc741360ba84d90c45463d7389945034f07c86c54031231/687474703a2f2f706f7365722e707567782e6f72672f7761796e6573746174652f6e6f76612d746578742d636f70792d6669656c642f6c6963656e7365)](https://packagist.org/packages/waynestate/nova-text-copy-field) [![PHP Version Require](https://camo.githubusercontent.com/63ef264737beb98a89e3cfc04dd872d2283535bc4e24547a3284fdc848f4fbeb/687474703a2f2f706f7365722e707567782e6f72672f7761796e6573746174652f6e6f76612d746578742d636f70792d6669656c642f726571756972652f706870)](https://packagist.org/packages/waynestate/nova-text-copy-field)

A Laravel Nova v5 text field with click to copy support. This field behaves just like a text field but adds the ability to copy the field value to your clipboard with just a click.

This package can also be found on [Nova Packages](https://novapackages.com/packages/waynestate/nova-text-copy-field).

[![animated screenshot](.docs/animated.gif)](.docs/animated.gif)

Installation
------------

[](#installation)

[Nova v4 compatibility instructions](https://github.com/waynestate/nova-text-copy-field#nova-v4-compatibility)

```
> composer require waynestate/nova-text-copy-field
```

Usage
-----

[](#usage)

Add the field to a resource.

```
use Waynestate\Nova\TextCopy\TextCopy;

public function fields(Request $request)
{
    return [
        TextCopy::make('Example Copy Field', 'example_copy_field'),
    ];
}
```

### Truncating long strings

[](#truncating-long-strings)

In some cases you may want to truncate the display of a fields value but allow still copy the full value. You can use the `truncate()` method to accomplish this.

```
TextCopy::make('Some Long Field')
    ->truncate(100)
```

### Masking the field value

[](#masking-the-field-value)

This works great for secrets like API Keys.

```
TextCopy::make('Some Secret String', 'some_secret_string')
    ->mask('❌') // default '*'
    ->truncate(5)
```

### Copy button title

[](#copy-button-title)

The title of the copy button defaults to the field name prefixed with 'Copy'. For example, `TextCopy::make('Some Field', 'some_field')` the button title will be "Copy Some Field".

If you would like to manually set the title you can use the `copyButtonTitle()` method.

```
TextCopy::make('Some Field', 'some_field')
    ->copyButtonTitle('Some alternative title')
```

### Alternative copy value

[](#alternative-copy-value)

You can choose to mutate and that is copied to the users clipboard. You can either pass a value or a Closure.

```
TextCopy::make('Some Secret String', 'some_long_string')
    ->copyValue(function ($value) {
        return substr($value, -6);
    })
```

or

```
TextCopy::make('Some Secret String', 'some_long_string')
    ->copyValue('some fixed copy value')
```

### Only displaying the button on hover

[](#only-displaying-the-button-on-hover)

```
TextCopy::make('Some Secret String', 'some_long_string')
    ->showButtonOnlyOnHover()
```

Screenshots
-----------

[](#screenshots)

### Default State

[](#default-state)

[![default](.docs/default.png)](.docs/default.png)[![default](.docs/index.png)](.docs/index.png)

### Success State

[](#success-state)

When the field value has been successfully copied to the user's clipboard. [![success](.docs/success.png)](.docs/success.png)

### Error State

[](#error-state)

When there is an error adding the field value to the user's clipboard. [![error](.docs/error.png)](.docs/error.png)

### Truncated Display Value

[](#truncated-display-value)

[![truncated display](.docs/truncated-screenshot.png)](.docs/truncated-screenshot.png)

### Masked Display Value

[](#masked-display-value)

[![masked display](.docs/masked-screenshot.png)](.docs/masked-screenshot.png)

Nova v4 compatibility
---------------------

[](#nova-v4-compatibility)

If you require the use of `nova-text-copy-field` using Nova v4 you can install using version [v2.0.5](https://github.com/waynestate/nova-text-copy-field/releases/tag/v2.0.5)

```
composer require waynestate/nova-text-copy-field:"^2.0.5"
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

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

Credits
-------

[](#credits)

- [Wayne State University](https://github/waynestate)
- [TJ Miller](https://github.com/sixlive)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

47

—

FairBetter than 94% of packages

Maintenance42

Moderate activity, may be stable

Popularity35

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity79

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~143 days

Recently: every ~204 days

Total

17

Last Release

480d ago

Major Versions

v0.2.0 → v1.0.02018-10-10

v1.6.0 → v2.0.02022-10-12

v2.0.5 → v3.0.02025-01-23

PHP version history (3 changes)v0.1.0PHP &gt;=7.1.0

v2.0.3PHP &gt;=7.3.0

v3.0.0PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/ee6b5aa170dcc656a78decb60be3034965518713f26fbe769b189686b5cbd38e?d=identicon)[nickdenardis](/maintainers/nickdenardis)

![](https://www.gravatar.com/avatar/8479005c4010d6614a6a61146f5fb27993c73be6c46353d096fc6276757da3e5?d=identicon)[chrispelzer](/maintainers/chrispelzer)

![](https://www.gravatar.com/avatar/d3e0d387e4c3e3ff7d8b8541e57612fe1b1b356ddfddf2ae6b29d810f4eb7be7?d=identicon)[anthonywayne](/maintainers/anthonywayne)

---

Top Contributors

[![chrispelzer](https://avatars.githubusercontent.com/u/636531?v=4)](https://github.com/chrispelzer "chrispelzer (30 commits)")[![sixlive](https://avatars.githubusercontent.com/u/5108034?v=4)](https://github.com/sixlive "sixlive (30 commits)")[![everestmx](https://avatars.githubusercontent.com/u/5403326?v=4)](https://github.com/everestmx "everestmx (2 commits)")[![mattdfloyd](https://avatars.githubusercontent.com/u/185187?v=4)](https://github.com/mattdfloyd "mattdfloyd (1 commits)")[![tnorthcutt](https://avatars.githubusercontent.com/u/796639?v=4)](https://github.com/tnorthcutt "tnorthcutt (1 commits)")

---

Tags

laravelnova

### Embed Badge

![Health badge](/badges/waynestate-nova-text-copy-field/health.svg)

```
[![Health](https://phpackages.com/badges/waynestate-nova-text-copy-field/health.svg)](https://phpackages.com/packages/waynestate-nova-text-copy-field)
```

###  Alternatives

[optimistdigital/nova-sortable

This Laravel Nova package allows you to reorder models in a Nova resource's index view using drag &amp; drop.

2872.1M6](/packages/optimistdigital-nova-sortable)[outl1ne/nova-sortable

This Laravel Nova package allows you to reorder models in a Nova resource's index view using drag &amp; drop.

2861.8M9](/packages/outl1ne-nova-sortable)[optimistdigital/nova-multiselect-field

A multiple select field for Laravel Nova.

3403.5M7](/packages/optimistdigital-nova-multiselect-field)[digital-creative/conditional-container

Provides an easy way to conditionally show and hide fields in your Nova resources.

116593.8k4](/packages/digital-creative-conditional-container)[sbine/route-viewer

A Laravel Nova tool to view your registered routes.

57215.9k](/packages/sbine-route-viewer)[markwalet/nova-modal-response

A Laravel Nova asset for Modal responses on an action.

14720.0k](/packages/markwalet-nova-modal-response)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
