{"id":19451694,"url":"https://github.com/akki-io/laravel-nova-search","last_synced_at":"2025-04-25T04:30:29.449Z","repository":{"id":43471135,"uuid":"291209513","full_name":"akki-io/laravel-nova-search","owner":"akki-io","description":"This package provides a trait that extends the search behaviour of laravel nova resource.","archived":false,"fork":false,"pushed_at":"2025-03-24T11:07:06.000Z","size":177,"stargazers_count":23,"open_issues_count":2,"forks_count":11,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-11T22:09:19.601Z","etag":null,"topics":["laravel","nova","php","search"],"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/akki-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-29T05:46:57.000Z","updated_at":"2025-03-23T23:59:23.000Z","dependencies_parsed_at":"2024-04-25T04:27:48.979Z","dependency_job_id":"6b49c393-ec3b-423b-bb3f-28793f0d4191","html_url":"https://github.com/akki-io/laravel-nova-search","commit_stats":{"total_commits":27,"total_committers":8,"mean_commits":3.375,"dds":0.4444444444444444,"last_synced_commit":"dc3b1a84fec62d632e77287f1859546411b4418b"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akki-io%2Flaravel-nova-search","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akki-io%2Flaravel-nova-search/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akki-io%2Flaravel-nova-search/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akki-io%2Flaravel-nova-search/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akki-io","download_url":"https://codeload.github.com/akki-io/laravel-nova-search/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250754533,"owners_count":21481832,"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","search"],"created_at":"2024-11-10T16:42:42.845Z","updated_at":"2025-04-25T04:30:29.128Z","avatar_url":"https://github.com/akki-io.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/akki-io/laravel-nova-search/master/hero.png\" alt=\"Hero\" width=\"600\"\u003e\n\u003c/p\u003e\n\n# Laravel Nova Search\n\n[![Latest Version](https://img.shields.io/github/release/akki-io/laravel-nova-search.svg?style=flat-square)](https://github.com/akki-io/laravel-nova-search/releases)\n[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)\n[![StyleCI](https://styleci.io/repos/291209513/shield?branch=master)](https://styleci.io/repos/291209513)\n[![Total Downloads](https://img.shields.io/packagist/dt/akki-io/laravel-nova-search.svg?style=flat-square)](https://packagist.org/packages/akki-io/laravel-nova-search)\n\n### Testing Statuses\n\nMySQL - ![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/akki-io/laravel-nova-search/test-mysql.yml?branch=master\u0026style=flat-square)\n\nSQLite - ![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/akki-io/laravel-nova-search/test-sqlite.yml?branch=master\u0026style=flat-square)\n\npgSQL - ![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/akki-io/laravel-nova-search/test-pgsql.yml?branch=master\u0026style=flat-square)\n\nThis package provides a trait that extends the search behaviour of laravel nova resource.\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require akki-io/laravel-nova-search\n```\n\nNext, add `AkkiIo\\LaravelNovaSearch\\LaravelNovaSearchable` trait to your base resource `App\\Nova\\Resource` class.\n\n```php\nuse AkkiIo\\LaravelNovaSearch\\LaravelNovaSearchable;\n\nabstract class Resource extends NovaResource\n{\n    use LaravelNovaSearchable;\n    \n    // ...\n}\n``` \n\n## Usage\n\nThis package DOES NOT have fuzzy matching capabilities. If you are looking for robust fuzzy matching capabilities provided by \"real\" search engines, you should look into [Laravel Scout](https://laravel.com/docs/scout).\n\nThis package adds the following types of search to your laravel nova resource.\n- Search multiple columns using concatenation.\n- Search every word in columns.\n- Search relationship columns.\n\n### Search multiple columns using concatenation.\n\nTo define which resource fields are searchable, you may assign a two-dimensional array of database columns in the `public static $searchConcatenation` property of your resource class. \nEach array in the array are names of columns that are concatenated using whitespace.   \n\n``` php\n/**\n * The columns that should be concatenated and searched.\n *\n * @var array\n */\n public static $searchConcatenation = [\n    ['first_name', 'last_name'],\n    ['first_name', 'company'],\n ];\n```\n\n### Search every word in columns.\n\nTo define which resource fields are searchable, you may assign an array of database columns in the `public static $searchMatchingAny` property of your resource class. \nEvery word in your input is searched for across all these columns. \n\n```php\n/**\n * The columns that should be searched for any matching entry.\n *\n * @var array\n */\n public static $searchMatchingAny = [\n    'first_name',\n    'last_name',\n    'email',\n ];\n```\n\n### Search relationship columns.\n\nTo define which resource fields are searchable, you may assign an array of database columns in the `public static $searchRelations` property of your resource class. \nThese database columns are from the related table that is used for searching. \nThis array has a relationship name as a key, and an array of columns to search for as a value.\n\n```php\n/**\n * The relationship columns that should be searched.\n *\n * @var array\n */\n public static $searchRelations = [\n     'posts' =\u003e ['title', 'sub_title'],\n ];\n```\n\n#### Nested relationships\n\nYou may search nested relationships using dot notation.\n\n```php\n/**\n * The relationship columns that should be searched.\n *\n * @var array\n */\npublic static $searchRelations = [\n    'user.location' =\u003e ['state_abbr', 'country_abbr'],\n];\n```\n\n#### Search multiple columns in relationship using concatenation.\n\nTo define which resource fields are searchable, you may assign a two-dimensional array of database columns in the `public static $searchRelationsConcatenation` property of your resource class.\nEach array in the array are names of columns that are concatenated using whitespace.\n\n``` php\n\n/**\n * The relationship columns that should to be concatenated and searched.\n *\n * @var array\n */\n public static $searchRelationsConcatenation = [\n    'user' =\u003e [\n        ['first_name', 'last_name'],\n        ['email']\n    ],\n ];\n```\n\n#### Search every word in columns of a relationship.\n\nTo define which resource fields are searchable, you may assign an array of database columns in the `public static $searchRelationsMatchingAny` property of your resource class.\nEvery word in your input is searched for across all these columns.\n\n```php\n/**\n * The relationship columns that should be searched for any matching entry.\n *\n * @var array\n */\n public static $searchRelationsMatchingAny = [\n    'user' =\u003e ['first_name', 'last_name'],\n ];\n```\n\n### Testing\n\n``` bash\ncomposer test\n```\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n### Security\n\nIf you discover any security related issues, please email hello@akki.io instead of using the issue tracker.\n\n## Credits\n\n- [Akki Khare](https://github.com/akki-io)\n- [Nova Search Relationship Package](https://github.com/TitasGailius/nova-search-relations)\n- [All Contributors](../../contributors)\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%2Fakki-io%2Flaravel-nova-search","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakki-io%2Flaravel-nova-search","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakki-io%2Flaravel-nova-search/lists"}