{"id":37374633,"url":"https://github.com/jdkweb/laravel-search","last_synced_at":"2026-01-16T05:02:05.805Z","repository":{"id":283462261,"uuid":"951835671","full_name":"jdkweb/laravel-search","owner":"jdkweb","description":"Laravel-Search is a search-engine using the models. Search easily, flexible add intelligent on your Laravel website or application","archived":false,"fork":false,"pushed_at":"2025-05-29T14:13:55.000Z","size":106,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-29T15:37:46.633Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jdkweb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2025-03-20T10:15:02.000Z","updated_at":"2025-05-29T14:08:34.000Z","dependencies_parsed_at":"2025-03-20T11:44:43.426Z","dependency_job_id":null,"html_url":"https://github.com/jdkweb/laravel-search","commit_stats":null,"previous_names":["jdkweb/laravel-search"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jdkweb/laravel-search","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdkweb%2Flaravel-search","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdkweb%2Flaravel-search/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdkweb%2Flaravel-search/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdkweb%2Flaravel-search/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jdkweb","download_url":"https://codeload.github.com/jdkweb/laravel-search/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdkweb%2Flaravel-search/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28477210,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T03:13:13.607Z","status":"ssl_error","status_checked_at":"2026-01-16T03:11:47.863Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2026-01-16T05:02:05.738Z","updated_at":"2026-01-16T05:02:05.795Z","avatar_url":"https://github.com/jdkweb.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# laravel Search\n[![Packagist Version](https://img.shields.io/packagist/v/jdkweb/search)](https://packagist.org/packages/jdkweb/search)\n[![Static Badge](https://img.shields.io/badge/build-%20%3E%3D%208.1-brightgreen?style=flat\u0026logo=php\u0026logoSize=16\u0026label=PHP)](https://github.com/jdkweb/rdw-api-filament) \n[![Static Badge](https://img.shields.io/badge/build-%20%3E%3D%2010-slategray?style=flat-square\u0026logo=laravel\u0026logoColor=white\u0026logoSize=16\u0026label=Laravel)](https://github.com/jdkweb/rdw-api-filament)\n\nLaravel-Search is a search-engine using the models. Search easily, flexible add intelligent on your Laravel website or application.\n\n[![Static Badge](https://img.shields.io/badge/build-jdkweb%2Fsearch-blue?style=flat-square\u0026logo=github\u0026label=Github)](https://github.com/jdkweb/search)\n[![Static Badge](https://img.shields.io/badge/build-jdkweb%2Fsearch-blue?style=flat-square\u0026logo=packagist\u0026logoColor=white\u0026label=Packagist)](https://packagist.org/packages/jdkweb/search)\n\n![laravel search](https://www.jdkweb.nl/git/images/laravel-search.webp)\n\n## Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Configuration with config-file](#configuration-with-config-file)\n    - [Search engine configuration](#search-engine-configuration)\n      - [Searchable model configuration](#searchable-model-configuration)\n      - [Example](#example)\n    - [Rename query strings parameters](#rename-query-strings-parameters)\n    - [Preset search words](#preset-search-words)\n    - [Search Result items per page](#search-result-items-per-page)\n    - [Example Config](#example-config)\n  - [Configuration directly embed settings in script](#configuration-directly-embed-settings-in-script)\n  - [Using the search engine](#using-the-search-engine) \n    - [Filters (search groups)](#filters-search-groups)\n- [Operators for conditions](#operators-for-conditions)  \n- [Filter specific words from the search](#filter-specific-words-from-the-search)  \n- [Methods and Closures](#methods-and-closures)\n- [Compare configuration settings](#compare-configuration-setting)\n\n\n## Installation\nRequires PHP 8.1 and Laravel 10 or higher \n\nInstall the package via composer:\n```bash\ncomposer require jdkweb/laravel-search\n```\n\n### Config\nFor configuration settings you need to publish the config\n```bash\nphp artisan vendor:publish --provider=\"Jdkweb\\Search\\SearchServiceProvider\" --tag=\"config\"\n```\nIn the config is needed for:\n- To setup reusable independent search-engine setting.\n- Change the list of words to filter from search\n- Change cache settings\n\n## Usage\n\n### Configuration with config file\n*Publish the config first.*\n\n- Define the models that need to be used in search engine \n- set default search conditions \n- define the output variables.\n\n\n#### Search engine configuration\n\nBase configuration for the search engine in the config-file\n```php\n'settings' =\u003e [    \n    '[CONFIG-NAME]' =\u003e [                      // Engine configuration name (standard preset: 'default')\n        'searchQuery' =\u003e '[PRESET SEARCH]',   // Optional: preset search words, results directly shown\n        'pagination' =\u003e 20,                   // Optional: search items per page , default = 15  \n        'parameters' =\u003e [                     // Optional: specific names query strings parameters           \n            'search_query' =\u003e '[NAME]',       // search terms, default: q\n            'actual_page' =\u003e '[NAME]',        // result page, default: p\n            'actual_filter' =\u003e '[NAME]'       // result filter, default: f\n        ],    \n        // Model configuration\n        ...\n    ]\n]\n```\n\n##### Searchable model configuration\n```php\n[\n    '[MODEL\\NAMESPACE]' =\u003e [\n        'searchFields' =\u003e [\n            [COLUMNAME] =\u003e [PRIORITY],\n            ...\n        ],\n        'conditions' =\u003e [ // Set search conditions (optional) \n            [COLUMNNAME] =\u003e [VALUE | METHOD | CLOSURE],\n            ...\n        ],\n        'resultFields' =\u003e [\n            [VARIABLENAME] =\u003e [COLUMNNAME | METHOD | CLOSURE],\n            ...\n        ]  \n    ]\n]\n```\n\n##### Example\n\nThe example below shows the configuration of a search engine named 'global'.\n\n```php\n'settings' =\u003e [    \n    'default' =\u003e [                      // Settings name 'default'\n        'searchQuery' =\u003e 'linux',       // Preset search 'linux'\n        'App\\Models\\Articles' =\u003e [      // Model to search: 'Articles'\n            'searchFields' =\u003e [         \n                'title' =\u003e 2.5,         // Column: title,  priority: 2.5 (extra weight) \n                'lead' =\u003e 2,            // Column: lead,   priority: 2  \n                'body' =\u003e 1,            \n                                        // In query: title LIKE '%[search words]%' OR lead LIKE '%[search words]%' ...\n            ],\n            'conditions' =\u003e [          \n                'active' =\u003e 1,          // query: active = 1 AND published = 1  \n                'published' =\u003e 1,       // \n            ],\n            'resultFields' =\u003e [         \n                'title' =\u003e 'pagetitle', // pagetitle usable as {{ $title }} \n                'lead' =\u003e 'intotext',   // introtext =\u003e {{ $lead }}\n                'url' =\u003e 'getSlug',     // call the method getSlug() in App\\Models\\Articles\n                                        // Closure to format a date in search result\n                'date' =\u003e fn () =\u003e \\Carbon\\Carbon::parse($this-\u003ecreated_at)-\u003eformat('d/m/Y') \n        ]                \n    ]\n],\n```\nIn short, one can defining multiple search engines. This makes it possible to create multiple specific search sets that behave different. \nYou can create a global search engine or one for a specific page/model.\n\n[See example of large configuration file with methods an closures](#example-config)\n\n#### Rename query strings parameters\nRenaming the GET variables that appear in the URL\n```php\n// Default\nsearch?q=some search words\u0026p=1\u0026f=articles\n\n// Modified using the setting below\nsearch?search=some search words\u0026page=1\u0026filter=articles \n```\n\n```php\n'settings' =\u003e [\n    'default' =\u003e [                              // Config name 'default'\n            'variables' =\u003e [                    \n                'search_query' =\u003e 'search',     // search terms\n                'actual_page' =\u003e 'page',        // result page\n                'actual_filter' =\u003e 'filter'     // result filter\n            ],    \n            'App\\Models\\Articles' =\u003e [\n            ...  \n```\n\n#### Preset search words\nIt is possible to fire a searchQuery by default.\n\nIn config file\n```php\n'settings' =\u003e [\n    'default' =\u003e [\n        'searchQuery' =\u003e 'Adobe',           // Set default search\n        ...\n```\n\n#### Search Result items per page\nChange search result items per page\n\n```php\n'settings' =\u003e [\n    'default' =\u003e [\n        'pagination' =\u003e 30,                 // 30 items per page, default is 15\n```\n\n```php\n'settings' =\u003e [\n    'default' =\u003e [\n        'pagination' =\u003e false,                 // All results on one page\n```\n\n#### Example config\nA setup for three different search engine configurations, each in a other situation with more specific search results\n- Global website search\n- Book / Chapter search\n- Article searching\n```php\n\u003c?php\n\n// Settings URL parameters \n$parameters = [\n    'search_query' =\u003e 'search',\n    'actual_page' =\u003e 'page',\n    'actual_filter' =\u003e 'filter'\n];\n\n// App\\Models\\Books for searching\n$books = [\n    'searchFields' =\u003e [\n        'name' =\u003e 3,\n        'body' =\u003e 2,\n        'intro' =\u003e 2\n    ],\n    'conditions' =\u003e [\n        'active' =\u003e 1,\n    ],\n    'resultFields' =\u003e [\n        'title' =\u003e 'name',\n        'text' =\u003e 'intro',\n        'cover' =\u003e function() {\n            return App\\Models\\BookCovers::query()\n                -\u003ewhere('id', $this-\u003eid)\n                -\u003efirst()            \n        }\n        'url' =\u003e fn() =\u003e \"/books/\".getSlug($this-\u003eshortname)\n    ]\n];\n\n// App\\Models\\Chapters (related to Books) for searching\n$chapter = [\n    'searchFields' =\u003e [\n        'name' =\u003e 3,\n        'intro' =\u003e 3,\n        'body' =\u003e 2,\n    ],\n    'conditions' =\u003e [\n        'active' =\u003e 1,\n        'book_id:in' =\u003e function () {\n            return App\\Models\\Book::query()\n                -\u003ewhere('active', 1)\n                -\u003eselect('id');\n        }\n    ],\n    'resultFields' =\u003e [\n        'title' =\u003e 'name',\n        'bookname' =\u003e function () {\n            return App\\Models\\Book::query()\n                -\u003ewhere('id', $this-\u003ebook_id)\n                -\u003eselect('name')-\u003efirst()-\u003ename;\n        },\n        'text' =\u003e 'intro',\n        'url' =\u003e 'getSlug'\n    ]\n];\n\n// App\\Models\\Articles for searching\n$articles = [\n    'searchFields' =\u003e [\n        'title' =\u003e 3,\n        'lead' =\u003e 2,\n        'content' =\u003e 1,\n    ],\n    'conditions' =\u003e [\n        'active' =\u003e 1,\n        'published:\u003c' =\u003e time()\n    ],\n    'resultFields' =\u003e [\n        'title' =\u003e 'title',\n        'text' =\u003e 'lead',\n        'thumbnail' =\u003e fn() =\u003e $this-\u003egetThumbnail(),\n        'url' =\u003e fn() =\u003e \"/articles/\".$this-\u003eslug\n    ]\n];\n\n// App\\Models\\Pages for searching\n$pages = [\n    'searchFields' =\u003e [\n        'title' =\u003e 3,\n        'introduction' =\u003e 3,\n        'content' =\u003e 2\n    ],\n    'conditions' =\u003e [\n        'active' =\u003e 1,\n        'parent_id:!=' =\u003e 88\n    ],\n    'resultFields' =\u003e [\n        'title' =\u003e 'title',\n        'text' =\u003e 'introduction',\n        'url' =\u003e fn() =\u003e \"/pages/\".getSlug($this-\u003ename)\n    ]\n];\n\nreturn [\n    'settings' =\u003e [\n        'default' =\u003e [                                      // Default search on search page on the website\n            'parameters' =\u003e $parameters,\n            'pagination' =\u003e 20\n            'App\\Models\\Articles' =\u003e $articles,         \n            'App\\Models\\Pages' =\u003e $pages\n            'App\\Models\\Books\\Book' =\u003e $books,\n            'App\\Models\\Books\\Chapter' =\u003e $chapter\n        ],\n        'books' =\u003e [                                        // searching in books and chapters\n            'parameters' =\u003e $parameters,\n            'pagination' =\u003e 10\n            'App\\Models\\Books\\Book' =\u003e $books,\n            'App\\Models\\Books\\Chapter' =\u003e $chapter,\n        ],\n        'articles' =\u003e [                                     // searching in articles\n            'parameters' =\u003e $parameters,\n            'pagination' =\u003e 5\n            'App\\Models\\Articles' =\u003e $articles,\n        ]\n    ]\n];\n```\n\n### Configuration directly embed settings in script\nWithout using a config file\n```php\n$search = app('search')                         // With default settings\n    -\u003esetSearchQuery('Adobe');                  // Optional: preset search words, results directly shown \n    -\u003esetPagination(10)                         // Optional: search items per page , default = 15\n    -\u003esetParams([                              // Optional: specific names query strings parameters\n        'search_query' =\u003e 'search',             // search terms\n        'actual_page' =\u003e 'page',                // result page\n        'actual_filter' =\u003e 'filter'             // result filter\n    ])\n    -\u003esetModel(\\App\\Models\\Articles::class, [   // Database Article table to search in\n        'title' =\u003e 2,                           // Fieldnames with priority (extra weight)     \n        'lead' =\u003e 1.5,       \n        'body' =\u003e 1,\n    ])\n    -\u003esetConditions(\\App\\Models\\Articles::class, [\n        'active' =\u003e 1,                          // active must be true\n        'created_at:\u003e' =\u003e '01-01-2025',         // articles created after 01 jan. 2025 \n    ])\n    -\u003eshowResults(\\App\\Models\\Articles::class, [\n        'title' =\u003e 'name',                      // pass database field = 'name' as 'title' to results\n        'lead' =\u003e 'intro',                      // pass database field = 'intro' as 'lead' to results\n        'url' =\u003e 'getSlug'                      // method in \\App\\Models\\Articles pass as 'url' to results\n    ])\n    -\u003esetModel(\\App\\Models\\User::class, [       // Database User table to search in\n        'name' =\u003e 1,                            // Fieldnames with priority (extra weight)\n        'email' =\u003e 1,\n    ])\n    -\u003esetConditions(\\App\\Models\\User::class, [\n        'active' =\u003e 1,                          // active must be true\n        'public:in' =\u003e function () {            // public value must be available, from Public model\n            return App\\Models\\Public::query()\n                -\u003ewhere('active', 1)\n                -\u003eselect('id');\n        }\n    ])\n    -\u003eshowResults(\\App\\Models\\User::class, [\n        'title' =\u003e function () {                // show name of user with the company name (from an other model)\n            $company_name = App\\Models\\Companies::query()\n                -\u003ewhere('user_id', $this-\u003eid)\n                -\u003eselect('company_name')-\u003efirst()-\u003ecompany_name        \n            return $this-\u003ename . \" (\" . $company_name .\")\"\n        },\n        'lead' =\u003e 'intro',\n        'url' =\u003e fn() =\u003e '/users/' . $this-\u003eslug  // closure arrow function to get slug passed as url to result    \n    ]);\n}\n```\n\n### Using the search engine\n\nLaravel-search is working with GET variables ([query strings parameters can be renamed](#rename-query-strings-parameters))\n```php\nsearch?q=some+search+words \n```\n\nBy default, if defined, the search engine configuration called 'default' is used.\n\n```php\n$search = app('search');  // search with 'default' settings\n\nOR\n\n$search = app('search', ['default']);  // search with 'default' settings\n\n// search result\n$result = $search-\u003eget();              // returning a collection \n```\n\nYou can use a custom configuration by calling the `settings()` methode\n\n```php\n$search = app('search', ['global']);     // search with 'global' settings\n// search result\n$result = $search-\u003eget();                // returning a collection\n```\n\n**Result:**\n\nordered by relevance \n```php\n  #items: Illuminate\\Support\\Collection {#3470 ▼\n    #items: array:15 [▼\n      0 =\u003e Illuminate\\Support\\Collection {#2268 ▶}\n      1 =\u003e Illuminate\\Support\\Collection {#3511 ▶}\n      2 =\u003e Illuminate\\Support\\Collection {#3260 ▶}\n      3 =\u003e Illuminate\\Support\\Collection {#3076 ▼\n        #items: array:3 [▼\n            \"title\" =\u003e \"Sed non leo ac massa dignissim condimentum\"\n            \"lead\" =\u003e \"Donec efficitur dictum justo vitae auctor. Curabitur eu diam a nisi eleifend tristique eget non augue. Integer sed metus non nisl fringilla venenatis.\"\n            \"url\" =\u003e \"/articles/sed-non-leo-ac-massa-dignissim\",\n            \"date\" =\u003e \"11/01/2025\" \n        ]\n        #escapeWhenCastingToString: false\n      }\n      4 =\u003e Illuminate\\Support\\Collection {#2335 ▶}\n      5 =\u003e Illuminate\\Support\\Collection {#2554 ▶}\n      ....\n    ]\n  }\n```\n\n#### Filters (search groups)\n![use result filters](https://www.jdkweb.nl/git/images/search-filters.webp)\n\nThe [searchable models](#searchable-model-configuration) we defined earlier can be used to create filters (or search groups). As shown in the example above.\n\nUse specific model or group of models for searching\n```php\n// available filters\n$filters = ['all','blog','articles','workshops']\n\n// get filter \u0026f=[FILTER] \n$filter = request()-\u003eget('f');\n\n$search = match($filter) {\n    'blog' =\u003e app('search', ['blog']);              \n    'articles' =\u003e app('search', ['articles']);\n    'workshops' =\u003e app('search', ['workshops']);\n    default =\u003e app('search');          \n};\n\n$result = $search-\u003eget();\n```\n\n### Operators for conditions\nIn the search conditions is it possible to use operators\n\n| Operator                      | Type                   | Example                         | Query Builder                           |\n|-------------------------------|------------------------|---------------------------------|-----------------------------------------| \n| =, \u003cwbr/\u003eeq                   | Equal                  | 'id' =\u003e 10  (default)           | -\u003ewhere('id',10)                        \n|                               |                        | 'id:=' =\u003e 10                    |\n| **!=**,\u003cwbr/\u003e !eq,\u003cwbr/\u003e neq  | Unequal                | 'id:!=' =\u003e 10                   | -\u003ewhere('id','!=', 10)                  \n|                               |                        | 'id:neq' =\u003e 10                  |\n| **\\\u003e**,\u003cwbr/\u003e gt              | Greater than           | 'age:\u003e' =\u003e 35                   |\n| **\\\u003e=**,\u003cwbr/\u003e gte            | Greater than or equal  | 'age:gte' =\u003e 35                 | -\u003ewhere('age', '\u003e=', 35)                \n| **\\\u003c**,\u003cwbr/\u003e lt              | Less than              | 'age:\u003c' =\u003e 12                   | -\u003ewhere('age', '\u003c', 12)                 \n| **\\\u003c=**,\u003cwbr/\u003e lte            | Less than or equal     | 'age:lte' =\u003e 12                 | -\u003ewhere('age', '\u003c=', 12)                \n| **in**                        | In                     | 'id:in' =\u003e [10,11,12]           | -\u003ewhereIn('id',[10,11,12])              \n| **!in**,\u003cwbr/\u003e notin          | Not in                 | 'id:!in' =\u003e [2,4]               | -\u003ewhereNotIn('id',[2,4])                \n| **like**                      | Like                   | 'title:like' =\u003e '%Linux%'       | -\u003ewhere('title', 'LIKE', '%linux%')     \n| **!like**,\u003cwbr/\u003e notlike      | Not like               | 'title:notlike' =\u003e '%linux%'    | -\u003ewhere('title', 'NOT LIKE', '%linux%') \n| **or**                        | Or                     | 'or:published' =\u003e 1             | -\u003eorWhere('published', 1)               \n|                               | Or                     | 'or:id:in' =\u003e [10,11]           | -\u003eorWhereIn('id', [10,11]])             \n\n```php\n'conditions' =\u003e [    \n    'book_id:!in' =\u003e function () {\n        return App\\Models\\Book::query()\n            -\u003ewhere('active', 0)\n            -\u003ewhere('published', 0)\n            -\u003eselect('id');\n    }\n    'or:preview' =\u003e 1\n],\n```\n\n### Filter specific words from the search\nLanguage related list of words that are filtered from the search\n\nRemoving Linking words (the, and, ...) makes it possible to keep the search results cleaner.\n```php\n'filter_words' =\u003e [\n    'nl' =\u003e  'de, en, of, als, het, een, van, op, ook',\n    'en' =\u003e  'the, or, else, and, like',\n    'de' =\u003e  'das, der, die, und',\n    'fr' =\u003e  'le, la, un, une',\n]\n```\n\n### Methods and Closures\nThe configurations above provide several examples of using methods and Closures.\n\nThis makes it possible to relate the models to Closure functions, and methods form (other) models or controllers.\n\n#### Methods\nIn config file\n```php\n'resultFields' =\u003e [         \n    'title' =\u003e 'name', \n    'lead' =\u003e 'intro',\n    'url' =\u003e 'getSlug'      // Method getSlug bind to the Articles class\n```\nDirectly into the script\n```php\n-\u003eshowResults(\\App\\Models\\Articles::class, [\n    'title' =\u003e 'name',\n    'lead' =\u003e 'intro',\n    'url' =\u003e 'getSlug'      // Method getSlug bind to the Articles class\n])\n```\nMethod in model (\\App\\Models\\Articles)\n```php\npublic function getSlug()\n{\n    return '/articles/' . $this-\u003ecreateSlug();\n}\n```\n#### Closures \n```php\n-\u003eshowResults(\\App\\Models\\Articles::class, [\n    'title' =\u003e 'name',                     \n    'lead' =\u003e 'intro',                     \n    'url' =\u003e fn() =\u003e '/articles/' . $this-\u003ecreateSlug();      // Arrow function             \n])\n```\n\n```php\n-\u003eshowResults(\\App\\Models\\Articles::class, [\n    'title' =\u003e 'name',                     \n    'lead' =\u003e 'intro',                     \n    'url' =\u003e function() {                   // Closure\n        return $this-\u003egetSlug()             // Method getSlug bind to the Articles class\n    },\n    'date' =\u003e fn () =\u003e \\Carbon\\Carbon::parse($this-\u003ecreated_at)-\u003eformat('d/m/Y')   // Arrow function                  \n])\n```\n## Compare configuration settings\n\nConfig-file\n```php\n'settings' =\u003e [\n    '[CONFIG-NAME]' =\u003e [\n        'searchQuery' =\u003e [PRESET SEARCH],\n        'pagination' =\u003e [ITEMS_PER_PAGE_OR_FALSE_FOR_ALL]\n        'parameters' =\u003e [\n            'search_query' =\u003e '[NAME]',  \n            'actual_page' =\u003e '[NAME]',     \n            'actual_filter' =\u003e '[NAME]'  \n        ],        \n        'MODEL\\NAMESPACE' =\u003e [\n            'searchFields' =\u003e [\n                [COLUMNAME] =\u003e [PRIORITY],\n                ...\n            ],\n            'conditions' =\u003e [\n                [COLUMNNAME] =\u003e [VALUE | METHOD | CLOSURE],\n                ...\n            ],\n            'resultFields' =\u003e [\n                [VARIABLENAME] =\u003e [COLUMNNAME | METHOD | CLOSURE],\n                ...\n            ]\n        ]    \n    ]\n]\n```\n```php\n$search = app('search', '[CONFIG-NAME]');\n$searchResult = $search-\u003eget();\n// Handle next search via GET-variable (searchQuery is overwritten)\n\n// OR combine config with direct settings \n$search-\u003esetSearchQuery([NEW SEARCH_WORDS]);\n$newsearchResult = $search-\u003eget();\n```\nDirectly embed settings into the script\n```php\n$search = app('search', ['inline'])                     // (No) Config-name can give a confict with actual config settings    \n    -\u003esetSearchQuery([PRESET SEARCH]);   \n    -\u003esetPagination([ITEMS_PER_PAGE_OR_FALSE_FOR_ALL])             \n    -\u003esetParams([\n        'search_query' =\u003e '[NAME]',  \n        'actual_page' =\u003e '[NAME]',     \n        'actual_filter' =\u003e '[NAME]'  \n    ])\n    -\u003esetModel([MODEL\\NAMESPACE]::class, [   \n        [COLUMNAME] =\u003e [PRIORITY],\n        ...\n    ])\n    -\u003esetConditions([MODEL\\NAMESPACE]::class, [\n        [COLUMNNAME] =\u003e [VALUE | METHOD | CLOSURE],\n        ...\n    ])\n    -\u003eshowResults([MODEL\\NAMESPACE]::class, [\n        [VARIABLENAME] =\u003e [COLUMNNAME | METHOD | CLOSURE],\n        ...\n    ])\n```\n\n```php\n$searchResult = $search-\u003eget();\n// Handle next search via GET-variable (setSearchQuery is overwritten)\n\n// OR insert new search words\n$search-\u003esetSearchQuery([NEW SEARCH WORDS]);\n$newsearchResult = $search-\u003eget();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdkweb%2Flaravel-search","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjdkweb%2Flaravel-search","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdkweb%2Flaravel-search/lists"}