{"id":25826548,"url":"https://github.com/webard/nova-zadarma","last_synced_at":"2025-02-28T15:35:19.127Z","repository":{"id":225656957,"uuid":"763154829","full_name":"webard/nova-zadarma","owner":"webard","description":"Zadarma VoIP Integration for Laravel Nova. Make and receive phone calls directly from your Nova interface.","archived":false,"fork":false,"pushed_at":"2024-09-24T19:43:34.000Z","size":1685,"stargazers_count":1,"open_issues_count":3,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-31T04:17:44.343Z","etag":null,"topics":["laravel","laravel-nova","nova","phone","phone-calls","voip","widget","zadarma"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/webard.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-25T17:44:55.000Z","updated_at":"2024-12-25T03:40:58.000Z","dependencies_parsed_at":"2024-03-29T09:28:02.797Z","dependency_job_id":"7a144b78-5e11-4cfd-bff6-ab6e266c2996","html_url":"https://github.com/webard/nova-zadarma","commit_stats":null,"previous_names":["webard/nova-zadarma"],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webard%2Fnova-zadarma","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webard%2Fnova-zadarma/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webard%2Fnova-zadarma/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webard%2Fnova-zadarma/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webard","download_url":"https://codeload.github.com/webard/nova-zadarma/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241175944,"owners_count":19922614,"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","laravel-nova","nova","phone","phone-calls","voip","widget","zadarma"],"created_at":"2025-02-28T15:35:15.030Z","updated_at":"2025-02-28T15:35:19.118Z","avatar_url":"https://github.com/webard.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel Nova Zadarma VoIP Integration\n\n## Description\n\nThis package provides integration between Laravel Nova and the Zadarma VoIP service. It allows you to make, receive and manage phone calls directly from your Nova interface!\n\n![Zadarma SIP User](screenshots/screenshot_2.png)\n\n![Zadarma SIP Phone Call](screenshots/screenshot_3.png)\n\n## Installation\n\n### Step 1: Install the package\n\nRun the following command to install the package:\n\n```sh\ncomposer require webard/nova-zadarma\n```\n\n### Step 2: Publish the configuration\n\nPublish the package configuration using the following command:\n\n```sh\nphp artisan vendor:publish --provider=\"Webard\\NovaZadarma\\NovaZadarmaServiceProvider\" --tag=config\n```\n\n### Step 3: Provide API keys from Zadarma\n\nAdd this lines to `.env` file and fill them:\n\n```sh\nZADARMA_KEY=\nZADARMA_SECRET=\nZADARMA_SIP_LOGIN=\n```\n\nZadarma Secret and Key you can find in Settings -\u003e Integrations and API -\u003e Keys and API:\n\n![Zadarma API Keys](screenshots/zadarma_1.png)\n\nZadarma SIP Login is the suffix of PBX number, which can be found under My PBX -\u003e Extensions.\n\nYour SIP Login is behind the painted field.\n\n![Zadarma SIP Login](screenshots/zadarma_2.png)\n\n### Step 4: Publish the migrations\n\nPublish the package migrations using the following command:\n\n```sh\nphp artisan vendor:publish --provider=\"Webard\\NovaZadarma\\NovaZadarmaServiceProvider\" --tag=migrations\n```\n\n### Step 5: Register tool in `NovaServiceProvider`\n\n```php\nuse Webard\\NovaZadarma\\NovaZadarmaTool;\n\npublic function tools()\n{\n    return [\n        ...\n        NovaZadarmaTool::make(),\n    ];\n}\n```\n\n### Step 6: Update the User model\n\n1. Add the `HasPhoneCalls` trait to the User model\n2. Add `zadarma_sip` and `phone_number` to `$fillable` property\n3. Cast `phone_number` field to ` E164PhoneNumberCast::class`.\n\n\n```php\nuse Propaganistas\\LaravelPhone\\Casts\\E164PhoneNumberCast;\nuse Webard\\NovaZadarma\\Traits\\HasPhoneCalls;\n\nclass User extends Authenticatable {\n    use HasPhoneCalls;\n\n    protected $fillable = [\n        ...\n        'zadarma_sip',\n        'phone_number'\n    ];\n\n     protected function casts(): array\n    {\n        return [\n            ...\n            'phone_number' =\u003e E164PhoneNumberCast::class,\n        ];\n    }\n}\n```\n\n### Step 7: Modify User resource\n\n1. Add `Zadarma SIP` field\n2. Add `Phone Number` field\n3. Add `UserPhoneCalls` field\n\n\n```php\nuse Webard\\NovaZadarma\\Nova\\Fields\\UserPhoneCalls;\n\nclass User extends Resource {\n    public function fields(NovaRequest $request)\n    {\n        return [\n            ...\n            Text::make(__('Zadarma SIP'), 'zadarma_sip')\n                -\u003esortable()\n                -\u003enullable()\n                -\u003erules('nullable', 'max:4'),\n\n            Text::make(__('Phone Number'), 'phone_number')\n                -\u003esortable()\n                -\u003erules('nullable', 'max:20', 'phone'),\n\n            UserPhoneCalls::make(),\n        ];\n    }\n}\n```\n\n### Step 8: Add the phone call action to the User resource\n\nAdd the `MakePhoneCall` action to the User resource:\n\n```php\nuse Webard\\NovaZadarma\\Nova\\Actions\\MakePhoneCall;\n\nclass User extends Resource {\n    public function actions(NovaRequest $request)\n    {\n        return [\n            ...\n            MakePhoneCall::make()\n                -\u003esole()\n        ];\n    }\n}\n```\n\n\u003e [!WARNING]\n\u003e `MakePhoneCall` action must be `sole`, because User can make call to only one user at time.\n\n\u003e [!TIP]\n\u003e You can add `-\u003ewithoutConfirmation()` method to action to allow making phone calls directly after clicking action.\n\n### Step 9: Fill SIP Number in your User profile of Nova\n\nGo to your User edit form and fill `Zadarma SIP` according to SIP number in Zadarma panel. Default created SIP number is 100:\n\n![Zadarma SIP User](screenshots/screenshot_1.png)\n\n## Webhooks\n\n### Step 1: Enable \"Notifications\" in integrations \n\nGo to Settings -\u003e Integrations and API -\u003e Integrations in Zadarma Panel and enable \"Notifications\" integration.\n\n![Zadarma Integrations](screenshots/zadarma_3.png)\n\n### Step 2: Fill settings of \"Notifications\" integration\n\nGo to Notifications settings and enter webhook URL:\n\n```\nhttps://YOUR-DOMAIN.com/nova-vendor/webard/nova-zadarma/webhook\n```\n\nand enable checkboxes:\n- NOTIFY_START\n- NOTIFY_END\n- NOTIFY_OUT_START\n- NOTIFY_OUT_END\n- NOTIFY_RECORD\n\n![Zadarma Notifications Settings](screenshots/zadarma_4.png)\n\n\n### Step 3: Add webhook URL to ignore\n\nGo to `bootstrap/app.php` file and modify `withMiddleware` method:\n\n```php\nreturn Application::configure(basePath: dirname(__DIR__))\n    -\u003ewithMiddleware(function (Middleware $middleware) {\n\n        $middleware-\u003evalidateCsrfTokens(except: [\n            '/nova-vendor/webard/nova-zadarma/webhook',\n        ]);\n        \n    })\n    -\u003ewithExceptions(function (Exceptions $exceptions) {\n        //\n    })\n    -\u003ecreate();\n```\n\nIf you have `fruitcake/laravel-telescope-toolbar` installed, add webhook URL to `ignore_paths` in `config/telescope-toolbar.php`\n\n\n```php\n'ignore-paths' =\u003e [\n    'nova-vendor/webard/nova-zadarma/webhook'\n]\n```\n\n## TODO\n\nI'm are actively seeking contributions to enhance this package. Here are some features I would love to see implemented:\n\n- [ ] documentation for Gate\n- [ ] documentation for Events\n- [ ] ability to go offline (disable widget on demand)\n- [ ] more options for icon in header\n- [ ] after call action modal with customized fields (feedback modal)\n- [ ] phone call transcriptions using OpenAI/Google Speech To Text/Assembly.ai\n \n## Contributing\n\nWe welcome contributions to improve this plugin! Please follow these steps to contribute:\n\n1. Fork the repository.\n2. Create a new branch for your feature or bug fix.\n3. Make your changes and commit them with descriptive messages.\n4. Push your changes to your forked repository.\n5. Open a pull request to the main repository.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE.md](LICENSE.md) file for more details.\n\n## Contact\n\nFor questions or support, please open an issue on GitHub.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebard%2Fnova-zadarma","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebard%2Fnova-zadarma","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebard%2Fnova-zadarma/lists"}