{"id":22889596,"url":"https://github.com/dillingham/nova-ajax-select","last_synced_at":"2025-10-13T02:34:03.901Z","repository":{"id":49452337,"uuid":"170025892","full_name":"dillingham/nova-ajax-select","owner":"dillingham","description":"Ajax select / child select package for Laravel Nova","archived":false,"fork":false,"pushed_at":"2024-05-29T12:08:13.000Z","size":171,"stargazers_count":87,"open_issues_count":14,"forks_count":21,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-10T02:58:42.758Z","etag":null,"topics":["laravel","laravel-nova"],"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/dillingham.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","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":"2019-02-10T20:52:01.000Z","updated_at":"2024-11-06T09:22:59.000Z","dependencies_parsed_at":"2024-06-18T15:29:38.947Z","dependency_job_id":"6d9d5b60-8c8e-4a4f-9026-07f475e568dd","html_url":"https://github.com/dillingham/nova-ajax-select","commit_stats":{"total_commits":53,"total_committers":2,"mean_commits":26.5,"dds":0.09433962264150941,"last_synced_commit":"501fe6dd1d3c2e781ba09588b3023d194a00f59a"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/dillingham/nova-ajax-select","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dillingham%2Fnova-ajax-select","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dillingham%2Fnova-ajax-select/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dillingham%2Fnova-ajax-select/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dillingham%2Fnova-ajax-select/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dillingham","download_url":"https://codeload.github.com/dillingham/nova-ajax-select/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dillingham%2Fnova-ajax-select/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279013998,"owners_count":26085345,"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-13T02:00:06.723Z","response_time":61,"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","laravel-nova"],"created_at":"2024-12-13T21:56:19.534Z","updated_at":"2025-10-13T02:34:03.884Z","avatar_url":"https://github.com/dillingham.png","language":"Vue","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nova Ajax Select\n\n[![Latest Version on Github](https://img.shields.io/github/release/dillingham/nova-ajax-select.svg?style=flat-square)](https://packagist.org/packages/dillingham/nova-ajax-select)\n[![Total Downloads](https://img.shields.io/packagist/dt/dillingham/nova-ajax-select.svg?style=flat-square)](https://packagist.org/packages/dillingham/nova-ajax-select) [![Twitter Follow](https://img.shields.io/twitter/follow/im_brian_d?color=%231da1f1\u0026label=Twitter\u0026logo=%231da1f1\u0026logoColor=%231da1f1\u0026style=flat-square)](https://twitter.com/im_brian_d)\n\nAjax populated select fields based on the values of other fields and when they change.\n\n![nova-ajax-select](https://user-images.githubusercontent.com/29180903/52602810-15c53900-2e32-11e9-9ade-492bfe80b234.gif)\n\n### Install\n```\ncomposer require dillingham/nova-ajax-select\n```\n\n### Usage\n\nSpecify a request url \u0026 optionally the `parent($attribute)` to watch \u0026 trigger the ajax select:\n\n```php\nuse NovaAjaxSelect\\AjaxSelect;\n```\n```php\nBelongsTo::make('Company'),\n\nAjaxSelect::make('User')\n    -\u003eget('/api/company/{company}/users')\n    -\u003eparent('company'),\n```\nAdd the field for index \u0026 detail views display. AjaxSelect is for forms only\n```php\nBelongsTo::make('User')-\u003eexceptOnForms(),\n```\n\n### Request Url:\n\nIn the above example, we say `company` is the parent.\n\nThe `{company}` url parameter will equal the selected `Company` field value.\n\n### Response Format:\n\nThe select field expects a `value` \u0026 `display`. Map your results like so:\n\n```php\nRoute::get('api/company/{company}/users', function($company_id) {\n\n    $company = \\App\\Company::find($company_id);\n\n    return $company-\u003eusers-\u003emap(function($user) {\n        return [ 'value' =\u003e $user-\u003eid, 'display' =\u003e $user-\u003ename ];\n    });\n})-\u003emiddleware(['nova']);\n```\n\n### Make children depend on other children\n\n`City` makes a request based on `State`, which makes a request based on `Country`:\n\n```php\nSelect::make('Country')\n    -\u003eoptions([]),\n\nAjaxSelect::make('State')\n    -\u003eget('/api/country/{country}/states')\n    -\u003eparent('country'),\n\nAjaxSelect::make('City')\n    -\u003eget('/api/state/{state}/cities')\n    -\u003eparent('state'),\n```\n### Make multiple children depend on one parent\n\n`File` \u0026 `Comment` will both make a request based on `Project`\n\n```php\nBelongsTo::make('Project'),\n\nAjaxSelect::make('File')\n    -\u003eget('/{project}/files')\n    -\u003eparent('project'),\n\nAjaxSelect::make('Comment')\n    -\u003eget('/{project}/comments')\n    -\u003eparent('project'),\n```\n\n---\n\n# Author\n\nHi 👋, Im Brian Dillingham, creator of this Nova package [and others](https://novapackages.com/collaborators/dillingham)\n\nHope you find it useful. Feel free to reach out with feedback.\n\nFollow me on twitter: [@im_brian_d](https://twitter.com/im_brian_d) \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdillingham%2Fnova-ajax-select","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdillingham%2Fnova-ajax-select","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdillingham%2Fnova-ajax-select/lists"}