{"id":15527175,"url":"https://github.com/sixlive/nova-text-copy-field","last_synced_at":"2025-04-10T00:18:55.638Z","repository":{"id":33111040,"uuid":"152124692","full_name":"sixlive/nova-text-copy-field","owner":"sixlive","description":"Nova text field with click to copy support","archived":false,"fork":false,"pushed_at":"2019-09-15T11:23:53.000Z","size":1114,"stargazers_count":70,"open_issues_count":8,"forks_count":15,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-02T22:06:06.163Z","etag":null,"topics":["laravel","nova","php"],"latest_commit_sha":null,"homepage":"","language":"Vue","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sixlive.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-08T18:10:15.000Z","updated_at":"2023-11-16T10:23:32.000Z","dependencies_parsed_at":"2022-08-07T20:00:35.685Z","dependency_job_id":null,"html_url":"https://github.com/sixlive/nova-text-copy-field","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sixlive%2Fnova-text-copy-field","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sixlive%2Fnova-text-copy-field/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sixlive%2Fnova-text-copy-field/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sixlive%2Fnova-text-copy-field/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sixlive","download_url":"https://codeload.github.com/sixlive/nova-text-copy-field/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248131379,"owners_count":21052828,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["laravel","nova","php"],"created_at":"2024-10-02T11:04:52.645Z","updated_at":"2025-04-10T00:18:55.615Z","avatar_url":"https://github.com/sixlive.png","language":"Vue","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nova Text Copy Field\n\n[![Packagist Version](https://img.shields.io/packagist/v/sixlive/nova-text-copy-field.svg?style=flat-square)](https://packagist.org/packages/sixlive/nova-text-copy-field)\n[![Packagist Downloads](https://img.shields.io/packagist/dt/sixlive/nova-text-copy-field.svg?style=flat-square)](https://packagist.org/packages/sixlive/nova-text-copy-field)\n[![StyleCI](https://github.styleci.io/repos/152124692/shield)](https://github.styleci.io/repos/152124692)\n\nA Laravel Nova 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.\n\nThis package can also be found on [Nova Packages](https://novapackages.com/packages/sixlive/nova-text-copy-field).\n\n![animated screenshot](.docs/animated.gif)\n\n## Installation\n\n```bash\n\u003e composer require sixlive/nova-text-copy-field\n```\n\n## Usage\nAdd the field to a resource.\n\n```php\nuse Sixlive\\TextCopy\\TextCopy;\n\npublic function fields(Request $request)\n{\n    return [\n        TextCopy::make('Example Copy Field', 'example_copy_field'),\n    ];\n}\n```\n\n### Truncating long strings\nIn 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.\n\n```php\nTextCopy::make('Some Long Field')\n    -\u003etruncate(100)\n```\n\n### Masking the field value\nThis works great for secrets like API Keys.\n\n```php\nTextCopy::make('Some Secret String', 'some_secret_string')\n    -\u003emask('❌') // default '*'\n    -\u003etruncate(5)\n```\n\n### Copy button title\nThe 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\".\n\nIf you would like to manually set the title you can use the `copyButtonTitle()` method.\n\n```php\nTextCopy::make('Some Field', 'some_field')\n    -\u003ecopyButtonTitle('Some alternative title')\n```\n\n### Alternative copy value\nYou can choose to mutate and that is copied to the users clipboard. You can either pass a value or a Closure.\n\n```php\nTextCopy::make('Some Secret String', 'some_long_string')\n    -\u003ecopyValue(function ($value) {\n        return substr($value, -6);\n    })\n```\n\nor \n\n```php\nTextCopy::make('Some Secret String', 'some_long_string')\n    -\u003ecopyValue('some fixed copy value')\n```\n\n### Only displaying the button on hover\n```php\nTextCopy::make('Some Secret String', 'some_long_string')\n    -\u003eshowButtonOnlyOnHover()\n```\n\n## Screenshots\n### Default State\n![default](.docs/default.png)\n![default](.docs/index.png)\n\n### Success State\nWhen the field value has been successfully copied to the user's clipboard.\n![success](.docs/success.png)\n\n### Error State\nWhen there is an error adding the field value to the user's clipboard.\n![error](.docs/error.png)\n\n### Truncated Display Value\n![truncated display](.docs/truncated-screenshot.png)\n\n### Masked Display Value\n![masked display](.docs/masked-screenshot.png)\n\n## Changelog\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Contributing\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n## Code Style\nStyleCI will apply the [Laravel preset](https://docs.styleci.io/presets#laravel).\n\n## Security\nIf you discover any security related issues, please email oss@tjmiller.co instead of using the issue tracker.\n\n## Credits\n- [TJ Miller](https://github.com/sixlive)\n- [All Contributors](../../contributors)\n\n## License\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsixlive%2Fnova-text-copy-field","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsixlive%2Fnova-text-copy-field","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsixlive%2Fnova-text-copy-field/lists"}