{"id":28291904,"url":"https://github.com/yieldstudio/nova-phone-field","last_synced_at":"2026-03-05T06:33:23.541Z","repository":{"id":53121662,"uuid":"498723980","full_name":"YieldStudio/nova-phone-field","owner":"YieldStudio","description":"Nova Phone Number field with a dynamic mask based on the country code inserted by the user.","archived":false,"fork":false,"pushed_at":"2024-06-01T23:00:59.000Z","size":1430,"stargazers_count":6,"open_issues_count":3,"forks_count":8,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-27T03:04:59.660Z","etag":null,"topics":["laravel","mask","nova","phone"],"latest_commit_sha":null,"homepage":"","language":"Vue","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/YieldStudio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-06-01T12:19:09.000Z","updated_at":"2024-02-19T13:57:34.000Z","dependencies_parsed_at":"2023-02-11T12:30:46.834Z","dependency_job_id":null,"html_url":"https://github.com/YieldStudio/nova-phone-field","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/YieldStudio/nova-phone-field","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YieldStudio%2Fnova-phone-field","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YieldStudio%2Fnova-phone-field/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YieldStudio%2Fnova-phone-field/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YieldStudio%2Fnova-phone-field/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YieldStudio","download_url":"https://codeload.github.com/YieldStudio/nova-phone-field/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YieldStudio%2Fnova-phone-field/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000638,"owners_count":26082818,"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","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","mask","nova","phone"],"created_at":"2025-05-22T04:12:17.810Z","updated_at":"2025-10-08T20:45:47.862Z","avatar_url":"https://github.com/YieldStudio.png","language":"Vue","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A global Phone Number field for Laravel Nova\n\n[![Latest Version](https://img.shields.io/github/release/yieldstudio/nova-phone-field?style=flat-square)](https://github.com/yieldstudio/nova-phone-field/releases)\n[![Total Downloads](https://img.shields.io/packagist/dt/yieldstudio/nova-phone-field?style=flat-square)](https://packagist.org/packages/yieldstudio/nova-phone-field)\n\nNova Phone Number field with a dynamic mask based on the country code inserted by the user.\n\nFork from [bissolli/nova-phone-field](https://github.com/bissolli/nova-phone-field) to maintain package.\n\n![screenshot of the phone field](https://raw.githubusercontent.com/YieldStudio/nova-phone-field/main/screenshot.gif)\n\n## Requirements\n\n- PHP **8.0+**\n- Laravel Nova **4.0+**\n- Laravel Framework **8.0+**\n\n**NOTE**: For Laravel version \u003c 8.0 or Nova \u003c 4 use [bissolli/nova-phone-field](https://github.com/bissolli/nova-phone-field).\n\n## Installation\n\nYou can install this package into a Laravel app that uses [Nova](https://nova.laravel.com) via composer:\n\n```bash\ncomposer require yieldstudio/nova-phone-field\n```\n\n## Usage\n\nGo straight to your Nova resource and use `YieldStudio\\NovaPhoneField\\PhoneNumber` field:\n\n```php\nnamespace App\\Nova;\n\nuse YieldStudio\\NovaPhoneField\\PhoneNumber;\n\nclass Member extends Resource\n{\n    // ...\n    \n    public function fields(Request $request)\n    {\n        return [\n            // ...\n            \n            PhoneNumber::make('Phone Number'),\n\n            // ...\n        ];\n    }\n}\n```\n\nNow you can view and add tags on the blog posts screen in your Nova app. All tags will be saved in the `tags` table. \n\n### Filtering\n\nBy default, every country mask available inside `yieldstudio/nova-phone-field/resources/js/data/phone-masks.json` will be loaded and working. However, you can always select the desired countries calling the `onlyCountries()` method.\n\n```php\nPhoneNumber::make('Phone Number')\n    -\u003eonlyCountries('BR', 'US', 'IE'),\n```\n\n### Custom number format\n\nYou can also add custom phone formats with `withCustomFormats()`.\n\n```php\nPhoneNumber::make('Phone Number')\n    -\u003ewithCustomFormats('+123 ## #.#', '+123 ## ####.####'),\n```\n\nOr else use only your own phone formats calling for `withCustomFormats()` among with `onlyCustomFormats()`.\n\n```php\nPhoneNumber::make('Phone Number')\n    -\u003ewithCustomFormats('+123 ## #.#', '+123 ## ####.####')\n    -\u003eonlyCustomFormats(),\n```\n\n## Migrate from 1.0.x\n\nIn 2.0 values are now stored in [E.164 format](https://en.wikipedia.org/wiki/E.164). Previously, the formatted value was stored, which later caused problems for usage.\n\nWith the E.164 format, you can use the phone number directly. We use [libphonenumber-js](https://www.npmjs.com/package/libphonenumber-js) to format it on the Index and Detail of your resources.\n\nTo replace previously saved values you can use this query :\n\n```sql\nUPDATE _table_ SET _field_=CONCAT('+', REGEXP_REPLACE(_field_, '\\\\D', ''))\n``` \n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n### Security\n\nIf you've found a bug regarding security please mail [contact@yieldstudio.fr](mailto:contact@yieldstudio.fr) instead of using the issue tracker.\n\n## Credits\n\n- [James Hemery](https://github.com/jameshemery)\n- [Gustavo Bissolli](https://github.com/bissolli)\n- Special thanks to [Robin Herbots](https://github.com/RobinHerbots) who built one of the best [InputMask](https://github.com/RobinHerbots/Inputmask) from the internet.\n\n## License\n\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%2Fyieldstudio%2Fnova-phone-field","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyieldstudio%2Fnova-phone-field","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyieldstudio%2Fnova-phone-field/lists"}