{"info":{"_postman_id":"82aa2769-e3c0-4a61-824e-d5142b4ac3fa","name":"Laravel Playground","description":"<html><head></head><body><h2 id=\"laravel-with-repository--service-pattern-implementation\">Laravel with Repository &amp; Service Pattern Implementation</h2>\n<h3 id=\"setup\">Setup</h3>\n<ul>\n<li>Run <code>git clone https://github.com/marco-bizmatesph/laravel-playground.git</code> to clone the project</li>\n<li>Run <code>composer install</code> in the root directory of the project.</li>\n<li>Copy the <code>.env.example</code> contents to <code>.env</code></li>\n<li>Set the database config in your <code>.env</code> file</li>\n<li>Run <code>php artisan migrate --seed</code> to build the database and seed the initial data.</li>\n<li>Run <code>php artisan key:generate</code> to generate keys for the project</li>\n<li>Run <code>php artisan serve</code> to launch the application.</li>\n<li>The project includes Telescope out of the box. This will allow you to see incoming requests and review how the queries are executed in the database. To access this, simple go to <code>/telescope</code> in the browser.</li>\n</ul>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"7526105","collectionId":"82aa2769-e3c0-4a61-824e-d5142b4ac3fa","publishedId":"SWTG7baM","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2020-02-06T11:01:48.000Z"},"item":[{"name":"API Resource","item":[{"name":"Index","id":"a7f20ae7-6bcd-4efd-80a1-3e4bfd3af75b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Accept","value":"application/json","type":"text"}],"url":"http://laravel-playground.local/api/user","description":"<p>Display a listing of the resource.</p>\n<h2 id=\"sql-query\">SQL Query:</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>select * from `users` where `users`.`deleted_at` is null\n</code></pre>","urlObject":{"protocol":"http","path":["api","user"],"host":["laravel-playground","local"],"query":[],"variable":[]}},"response":[],"_postman_id":"a7f20ae7-6bcd-4efd-80a1-3e4bfd3af75b"},{"name":"Show","id":"bb9c31c0-9bd7-403f-8a31-bf60bdb1465c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Accept","value":"application/json","type":"text"}],"url":"http://laravel-playground.local/api/user/1","description":"<p>Display the specified resource.</p>\n<h2 id=\"sql-query\">SQL query:</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>select * from `users` where `users`.`id` = '1' and `users`.`deleted_at` is null limit 1  \n</code></pre>","urlObject":{"protocol":"http","path":["api","user","1"],"host":["laravel-playground","local"],"query":[],"variable":[]}},"response":[],"_postman_id":"bb9c31c0-9bd7-403f-8a31-bf60bdb1465c"},{"name":"Store","id":"005328df-ffe1-4783-bc87-f029a8a395ee","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/x-www-form-urlencoded","type":"text"},{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"urlencoded","urlencoded":[{"key":"name","value":"Elizabeth Christiansen Sr.","type":"text"},{"key":"email","value":"egibson@example.com","type":"text"},{"key":"password","value":"password","type":"text"},{"key":"password_confirmation","value":"password","type":"text"}]},"url":"http://laravel-playground.local/api/user","description":"<p>Store a newly created resource in storage.</p>\n<h2 id=\"sql-query\">SQL Query:</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>insert into\n  `users` (\n    `name`,\n    `email`,\n    `password`,\n    `updated_at`,\n    `created_at`\n  )\nvalues\n  (\n    'Elizabeth Christiansen Sr.',\n    'egibson@example.com',\n    'password',\n    '2020-02-27 02:49:55',\n    '2020-02-27 02:49:55'\n  )\n</code></pre>","urlObject":{"protocol":"http","path":["api","user"],"host":["laravel-playground","local"],"query":[],"variable":[]}},"response":[],"_postman_id":"005328df-ffe1-4783-bc87-f029a8a395ee"},{"name":"Update","id":"b4d62411-833b-4d67-9045-bb3ba067f1bc","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[{"key":"Content-Type","name":"Content-Type","value":"application/x-www-form-urlencoded","type":"text"},{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"urlencoded","urlencoded":[{"key":"name","value":"Elizabeth Christiansen Sr.","type":"text"},{"key":"email","value":"egibson@example.com","type":"text"},{"key":"password","value":"password","type":"text"},{"key":"password_confirmation","value":"password","type":"text"}]},"url":"http://laravel-playground.local/api/user/1","description":"<p>Update the specified resource in storage.</p>\n<h2 id=\"sql-query\">SQL Query:</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>update\n  `users`\nset\n  `name` = 'Elizabeth Christiansen Sr.',\n  `email` = 'egibson1@example.com',\n  `password` = 'password',\n  `users`.`updated_at` = '2020-02-27 02:51:04'\nwhere\n  `id` = 1\n</code></pre>","urlObject":{"protocol":"http","path":["api","user","1"],"host":["laravel-playground","local"],"query":[],"variable":[]}},"response":[],"_postman_id":"b4d62411-833b-4d67-9045-bb3ba067f1bc"},{"name":"Destroy","id":"da2406e9-903b-4d10-be8b-ea9e4a79d90b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[{"key":"Accept","value":"application/json","type":"text"}],"url":"http://laravel-playground.local/api/user/1","description":"<p>Remove the specified resource from storage. This operation was a soft delete.</p>\n<h2 id=\"sql-query\">SQL Query:</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>update\n  `users`\nset\n  `deleted_at` = '2020-02-27 02:51:41',\n  `users`.`updated_at` = '2020-02-27 02:51:41'\nwhere\n  `id` = 1\n</code></pre>","urlObject":{"protocol":"http","path":["api","user","1"],"host":["laravel-playground","local"],"query":[],"variable":[]}},"response":[],"_postman_id":"da2406e9-903b-4d10-be8b-ea9e4a79d90b"}],"id":"fa76e682-777c-43a6-b490-d0bde0ff21c5","description":"<p>The API Resource is the most common API endpoints showcasing to listing of all records, showing of a single record by id, creating a new record, updating an existing record, and deleting a record.</p>\n","event":[{"listen":"prerequest","script":{"id":"33a7311e-9eff-4b20-a621-8ea01c603e5b","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"1d4bcf97-09f6-43d8-ba7a-924fc7ab5453","type":"text/javascript","exec":[""]}}],"_postman_id":"fa76e682-777c-43a6-b490-d0bde0ff21c5"},{"name":"Simple Search","item":[{"name":"Get the first result","id":"43481004-659b-47ed-8330-d6cb210a5d40","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Content-Type","name":"Content-Type","type":"text","value":"application/json"},{"key":"Accept","type":"text","value":"application/json"}],"url":"http://laravel-playground.local/api/user/search?first=1","description":"<h2 id=\"sql-query\">SQL Query</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>select * from `users` where `users`.`deleted_at` is null limit 1   \n</code></pre>","urlObject":{"protocol":"http","path":["api","user","search"],"host":["laravel-playground","local"],"query":[{"key":"first","value":"1"}],"variable":[]}},"response":[],"_postman_id":"43481004-659b-47ed-8330-d6cb210a5d40"},{"name":"Get paginated results","id":"e8af620e-b215-4127-a49b-55b8e93ba566","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Content-Type","name":"Content-Type","type":"text","value":"application/json"},{"key":"Accept","type":"text","value":"application/json"}],"url":"http://laravel-playground.local/api/user/search?perPage=10&page=2","description":"<h2 id=\"query-parameters\">Query Parameters</h2>\n<ul>\n<li><code>perPage</code> is the number of items in a single pagination. </li>\n<li><code>page</code> is the page number in the pagination based on <code>perPage</code>.</li>\n</ul>\n<h2 id=\"sql-query\">SQL Query:</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>select * from `users` where `users`.`deleted_at` is null limit 10 offset 10 \n</code></pre>","urlObject":{"protocol":"http","path":["api","user","search"],"host":["laravel-playground","local"],"query":[{"key":"perPage","value":"10"},{"key":"page","value":"2"}],"variable":[]}},"response":[],"_postman_id":"e8af620e-b215-4127-a49b-55b8e93ba566"},{"name":"Search using a string value","id":"95d206ff-cabd-4eb7-a078-a88bc214fc5a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Content-Type","name":"Content-Type","type":"text","value":"application/json"},{"key":"Accept","type":"text","value":"application/json"}],"body":{"mode":"raw","raw":""},"url":"http://laravel-playground.local/api/user/search?name=Mr.","description":"<h2 id=\"sql-query\">SQL Query:</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>select * from `users` where (`name` like 'Mr.%') and `users`.`deleted_at` is null \n</code></pre>","urlObject":{"protocol":"http","path":["api","user","search"],"host":["laravel-playground","local"],"query":[{"key":"name","value":"Mr."}],"variable":[]}},"response":[],"_postman_id":"95d206ff-cabd-4eb7-a078-a88bc214fc5a"},{"name":"Search using multiple string values","id":"6f0dd8c4-5f0d-4a41-8cc9-22ee634804b9","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Content-Type","name":"Content-Type","type":"text","value":"application/json"},{"key":"Accept","type":"text","value":"application/json"}],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"http://laravel-playground.local/api/user/search?name[]=Trenton Jones&name[]=Miss Marie Durgan III","description":"<p>Array parameters will use a <code>whereIn</code> statement.</p>\n<h2 id=\"sql-query\">SQL Query:</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>select\n  *\nfrom\n  `users`\nwhere\n  (\n    `name` in ('Trenton Jones', 'Miss Marie Durgan III')\n  )\n  and `users`.`deleted_at` is null\n</code></pre>","urlObject":{"protocol":"http","path":["api","user","search"],"host":["laravel-playground","local"],"query":[{"key":"name[]","value":"Trenton Jones"},{"key":"name[]","value":"Miss Marie Durgan III"}],"variable":[]}},"response":[],"_postman_id":"6f0dd8c4-5f0d-4a41-8cc9-22ee634804b9"},{"name":"Search using a numeric value","id":"f8e11d5e-11b9-42cd-865b-4a7ebbf745e4","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Content-Type","name":"Content-Type","type":"text","value":"application/json"},{"key":"Accept","type":"text","value":"application/json"}],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"http://laravel-playground.local/api/user/search?id=2","description":"<h2 id=\"sql-query\">SQL Query:</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>select\n  *\nfrom\n  `users`\nwhere\n  (`id` = '2')\n  and `users`.`deleted_at` is null\n</code></pre>","urlObject":{"protocol":"http","path":["api","user","search"],"host":["laravel-playground","local"],"query":[{"key":"id","value":"2"}],"variable":[]}},"response":[],"_postman_id":"f8e11d5e-11b9-42cd-865b-4a7ebbf745e4"},{"name":"Search using multiple numeric values","id":"d213f0a1-ff3f-4d52-bf23-6d043399fde5","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Content-Type","name":"Content-Type","type":"text","value":"application/json"},{"key":"Accept","type":"text","value":"application/json"}],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"http://laravel-playground.local/api/user/search?id[]=2&id[]=100","description":"<p>Array parameters will use a <code>in</code> statement.</p>\n<h2 id=\"sql-query\">SQL Query</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>select * from `users` where (`id` in ('2', '100')) and `users`.`deleted_at` is null\n</code></pre>","urlObject":{"protocol":"http","path":["api","user","search"],"host":["laravel-playground","local"],"query":[{"key":"id[]","value":"2"},{"key":"id[]","value":"100"}],"variable":[]}},"response":[],"_postman_id":"d213f0a1-ff3f-4d52-bf23-6d043399fde5"},{"name":"Search using a date value","id":"11d44bdf-27a2-4865-a850-1cd1d1efec76","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Content-Type","name":"Content-Type","type":"text","value":"application/json"},{"key":"Accept","type":"text","value":"application/json"}],"body":{"mode":"raw","raw":""},"url":"http://laravel-playground.local/api/user/search?email_verified_at=2020-01-29 05:25:50","description":"<h2 id=\"sql-query\">SQL Query</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>select\n  *\nfrom\n  `users`\nwhere\n  (`email_verified_at` = '2020-01-29 05:25:50')\n  and `users`.`deleted_at` is null\n</code></pre>","urlObject":{"protocol":"http","path":["api","user","search"],"host":["laravel-playground","local"],"query":[{"key":"email_verified_at","value":"2020-01-29 05:25:50"}],"variable":[]}},"response":[],"_postman_id":"11d44bdf-27a2-4865-a850-1cd1d1efec76"},{"name":"Search using multiple date values","id":"b88872f0-3fdb-4379-a634-9aa9a235b95c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"},{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":""},"url":"http://laravel-playground.local/api/user/search?email_verified_at[]=2019-03-22 18:02:12&email_verified_at[]=2019-07-25 00:40:32","description":"<p>Array parameters will use <code>in</code> statement.</p>\n<h2 id=\"sql-query\">SQL Query</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>select\n  *\nfrom\n  `users`\nwhere\n  (\n    `email_verified_at` in ('2019-03-22 18:02:12', '2019-07-25 00:40:32')\n  )\n  and `users`.`deleted_at` is null\n</code></pre>","urlObject":{"protocol":"http","path":["api","user","search"],"host":["laravel-playground","local"],"query":[{"key":"email_verified_at[]","value":"2019-03-22 18:02:12"},{"key":"email_verified_at[]","value":"2019-07-25 00:40:32"}],"variable":[]}},"response":[],"_postman_id":"b88872f0-3fdb-4379-a634-9aa9a235b95c"},{"name":"Search using multiple conditions","id":"476bcefe-2b64-47d9-a29e-31075b83775d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"},{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":""},"url":"http://laravel-playground.local/api/user/search?id=2&name=Mr.&perPage=2","description":"<p>By default, the query will use <code>or</code> if strict is not provided.</p>\n<h2 id=\"sql-query\">SQL Query</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>select\n  *\nfrom\n  `users`\nwhere\n  (\n    `id` = '2'\n    or `name` like 'Mr.%'\n  )\n  and `users`.`deleted_at` is null\nlimit\n  2 offset 0\n</code></pre>","urlObject":{"protocol":"http","path":["api","user","search"],"host":["laravel-playground","local"],"query":[{"key":"id","value":"2"},{"key":"name","value":"Mr."},{"key":"perPage","value":"2"}],"variable":[]}},"response":[],"_postman_id":"476bcefe-2b64-47d9-a29e-31075b83775d"},{"name":"Search using multiple strict conditions","id":"fe49e767-5950-4430-8297-983f7ca005de","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"},{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":""},"url":"http://laravel-playground.local/api/user/search?id[]=1&id[]=66&name=Mr.&strict=true","description":"<p>If <code>strict</code> is specified. It will use <code>and</code> to combine the <code>where</code> statement.</p>\n<h2 id=\"sql-query\">SQL Query:</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>select\n  *\nfrom\n  `users`\nwhere\n  (\n    `id` in ('1', '66')\n    and `name` like 'Mr.%'\n  )\n  and `users`.`deleted_at` is null\n</code></pre>","urlObject":{"protocol":"http","path":["api","user","search"],"host":["laravel-playground","local"],"query":[{"key":"id[]","value":"1"},{"key":"id[]","value":"66"},{"key":"name","value":"Mr."},{"key":"strict","value":"true"}],"variable":[]}},"response":[],"_postman_id":"fe49e767-5950-4430-8297-983f7ca005de"},{"name":"Simple search but inverse result","id":"41133e14-12ee-4c7a-96ef-4b44a5bd7552","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"},{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"http://laravel-playground.local/api/user/search?name=Mr.&inverse=true","description":"<p>If <code>inverse</code> is specified, if will do the opposite of the parameters.</p>\n<h2 id=\"sql-query\">SQL query:</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>select\n  *\nfrom\n  `users`\nwhere\n  (`name` not like 'Mr.%')\n  and `users`.`deleted_at` is null\n</code></pre>","urlObject":{"protocol":"http","path":["api","user","search"],"host":["laravel-playground","local"],"query":[{"key":"name","value":"Mr."},{"key":"inverse","value":"true"}],"variable":[]}},"response":[],"_postman_id":"41133e14-12ee-4c7a-96ef-4b44a5bd7552"},{"name":"Simple search with related data","id":"c650e98b-4210-416f-b5c0-f84c0ab05c10","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"},{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"http://laravel-playground.local/api/user/search?name=Mr.&with[]=posts&first=1","description":"<p>If <code>with</code> is specified, the related model will be included in the query. Given that the relationship was declared in the model itself.</p>\n<h2 id=\"sql-query---users-table\">SQL Query - Users Table</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>select * from `users` where (`name` like 'Mr.%') and `users`.`deleted_at` is null limit 1   \n</code></pre><h2 id=\"sql-query---posts-table-related-data\">SQL Query - Posts Table (related data)</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>select * from `posts` where `posts`.`user_id` in (5)    \n</code></pre>","urlObject":{"protocol":"http","path":["api","user","search"],"host":["laravel-playground","local"],"query":[{"key":"name","value":"Mr."},{"key":"with[]","value":"posts"},{"key":"first","value":"1"}],"variable":[]}},"response":[],"_postman_id":"c650e98b-4210-416f-b5c0-f84c0ab05c10"},{"name":"Simple search with related data count","id":"4a1d1c72-82e0-4b78-8b35-0da64f95e469","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"},{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"http://laravel-playground.local/api/user/search?name=Mr.&withCount[]=posts&first=1","description":"<p>If <code>withCount</code> is specified, the related model will be counted and attached as <code>models_count</code>.</p>\n<h2 id=\"sql-query\">SQL Query</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>select\n  `users`.*,\n  (\n    select\n      count(*)\n    from\n      `posts`\n    where\n      `users`.`id` = `posts`.`user_id`\n  ) as `posts_count`\nfrom\n  `users`\nwhere\n  (`name` like 'Mr.%')\n  and `users`.`deleted_at` is null\nlimit\n  1\n</code></pre>","urlObject":{"protocol":"http","path":["api","user","search"],"host":["laravel-playground","local"],"query":[{"key":"name","value":"Mr."},{"key":"withCount[]","value":"posts"},{"key":"first","value":"1"}],"variable":[]}},"response":[],"_postman_id":"4a1d1c72-82e0-4b78-8b35-0da64f95e469"},{"name":"Simple search with deleted records","id":"2ae5137b-4bef-46eb-95a7-31b87c709344","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"},{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"http://laravel-playground.local/api/user/search?withTrashed=1","description":"<p>If <code>withTrashed</code> is specified, records that were soft deleted will be included in the list.</p>\n<h2 id=\"sql-query\">SQL Query:</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>select * from `users`\n</code></pre>","urlObject":{"protocol":"http","path":["api","user","search"],"host":["laravel-playground","local"],"query":[{"key":"withTrashed","value":"1"}],"variable":[]}},"response":[],"_postman_id":"2ae5137b-4bef-46eb-95a7-31b87c709344"},{"name":"Simple search only deleted records","id":"cde4dc45-56e7-4e84-be13-92ed934789c3","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"},{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"http://laravel-playground.local/api/user/search?onlyTrashed=1","description":"<p>If <code>onlyTrashed</code> is specified, only the soft deleted records will be listed.</p>\n<h2 id=\"sql-query\">SQL Query:</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>select * from `users` where `users`.`deleted_at` is not null    \n</code></pre>","urlObject":{"protocol":"http","path":["api","user","search"],"host":["laravel-playground","local"],"query":[{"key":"onlyTrashed","value":"1"}],"variable":[]}},"response":[],"_postman_id":"cde4dc45-56e7-4e84-be13-92ed934789c3"},{"name":"Simple search single sort ascending","id":"d5b47df6-07d7-4e53-923e-7f45a24047dd","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"},{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":""},"url":"http://laravel-playground.local/api/user/search?name=Mr.&perPage=10&orderBy=name","description":"<p>If <code>orderBy</code> is specified, it will sort the list according to the column given.</p>\n<h2 id=\"sql-query\">SQL Query:</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>select\n  *\nfrom\n  `users`\nwhere\n  (`name` like 'Mr.%')\n  and `users`.`deleted_at` is null\norder by\n  `name` asc\nlimit\n  10 offset 0\n</code></pre>","urlObject":{"protocol":"http","path":["api","user","search"],"host":["laravel-playground","local"],"query":[{"key":"name","value":"Mr."},{"key":"perPage","value":"10"},{"key":"orderBy","value":"name"}],"variable":[]}},"response":[],"_postman_id":"d5b47df6-07d7-4e53-923e-7f45a24047dd"},{"name":"Simple search single sort descending","id":"02d3f6ba-7999-41bf-90c6-9d934d3fcabc","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"},{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"http://laravel-playground.local/api/user/search?name=Mr.&descending=1&orderBy=id","description":"<p>If <code>descending</code> is set to true, it will sort the list in descending order. <code>orderBy</code> needs to be specified.</p>\n<h2 id=\"sql-query\">SQL Query:</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>select\n  *\nfrom\n  `users`\nwhere\n  (`name` like 'Mr.%')\n  and `users`.`deleted_at` is null\norder by\n  `id` desc\n</code></pre>","urlObject":{"protocol":"http","path":["api","user","search"],"host":["laravel-playground","local"],"query":[{"key":"name","value":"Mr."},{"key":"descending","value":"1"},{"key":"orderBy","value":"id"}],"variable":[]}},"response":[],"_postman_id":"02d3f6ba-7999-41bf-90c6-9d934d3fcabc"}],"id":"99512c41-ec3e-4ce1-9cbb-941e9826867d","description":"<p>Simple search can only be accessed through a <code>GET</code> request. This provides the client a simpler way to fetch data from our API. This search only uses a single where statement in its query. The request cannot handle nested json in the parameter.</p>\n","event":[{"listen":"prerequest","script":{"id":"d7898dc4-d873-43e9-8dab-dfc1f5133048","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"d0ec59ee-0618-4c5b-9e43-11a264352089","type":"text/javascript","exec":[""]}}],"_postman_id":"99512c41-ec3e-4ce1-9cbb-941e9826867d"},{"name":"Advanced Search","item":[{"name":"Advanced search using less than a given number","id":"4e86ea6b-dd10-46c9-b3cb-79717b5bcf40","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"},{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"where\": [\n\t\t{\n\t\t\t\"id\": {\n\t\t\t\t\"lessThan\": 3\n\t\t\t}\n\t\t}\n\t]\n}","options":{"raw":{"language":"json"}}},"url":"http://laravel-playground.local/api/user/search","description":"<p>For <code>numeric</code> columns, if <code>lessThan</code> is specified, the query will use <code>&lt;</code>.</p>\n<h2 id=\"sql-query\">SQL Query:</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>select * from `users` where (`id` &lt; 3) and `users`.`deleted_at` is null \n</code></pre>","urlObject":{"protocol":"http","path":["api","user","search"],"host":["laravel-playground","local"],"query":[],"variable":[]}},"response":[],"_postman_id":"4e86ea6b-dd10-46c9-b3cb-79717b5bcf40"},{"name":"Advanced search using less than or equal to a given number","id":"8b5690be-bd42-4bee-8cfd-242855e41c2f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Accept","value":"application/json","type":"text"},{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"where\": [\n\t\t{\n\t\t\t\"id\": {\n\t\t\t\t\"lessThanOrEqualTo\": 3\n\t\t\t}\n\t\t}\n\t]\n}"},"url":"http://laravel-playground.local/api/user/search","description":"<p>For <code>numeric</code> columns, if <code>lessThanOrEqualTo</code> is specified, the query will use <code>&lt;=</code>.</p>\n<h2 id=\"sql-query\">SQL Query:</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>select * from `users` where (`id` &lt;= 3) and `users`.`deleted_at` is null    \n</code></pre>","urlObject":{"protocol":"http","path":["api","user","search"],"host":["laravel-playground","local"],"query":[],"variable":[]}},"response":[],"_postman_id":"8b5690be-bd42-4bee-8cfd-242855e41c2f"},{"name":"Advanced search using greater than a given number","id":"60e55b1d-199d-44ca-8f75-b0c4f00b82b8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Accept","type":"text","value":"application/json"},{"key":"Content-Type","name":"Content-Type","type":"text","value":"application/json"}],"body":{"mode":"raw","raw":"{\n\t\"where\": [\n\t\t{\n\t\t\t\"id\": {\n\t\t\t\t\"greaterThan\": 98\n\t\t\t}\n\t\t}\n\t]\n}"},"url":"http://laravel-playground.local/api/user/search","description":"<p>For <code>numeric</code> columns, if <code>greaterThan</code> is specified, the query will use <code>&gt;</code>.</p>\n<h2 id=\"sql-query\">SQL Query:</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>select * from `users` where (`id` &gt; 98) and `users`.`deleted_at` is null    \n</code></pre>","urlObject":{"protocol":"http","path":["api","user","search"],"host":["laravel-playground","local"],"query":[],"variable":[]}},"response":[],"_postman_id":"60e55b1d-199d-44ca-8f75-b0c4f00b82b8"},{"name":"Advanced search using greater than or equal to a given number","id":"5e549e85-015d-4ef2-af01-4661949122c1","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Accept","value":"application/json","type":"text"},{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"where\": [\n\t\t{\n\t\t\t\"id\": {\n\t\t\t\t\"greaterThanOrEqualTo\": 98\n\t\t\t}\n\t\t}\n\t]\n}"},"url":"http://laravel-playground.local/api/user/search","description":"<p>For <code>numeric</code> columns, if <code>greaterThanOrEqualTo</code> is specified, the query will use <code>&gt;=</code>.</p>\n<h2 id=\"sql-query\">SQL Query:</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>select * from `users` where (`id` &gt;= 98) and `users`.`deleted_at` is null   \n</code></pre>","urlObject":{"protocol":"http","path":["api","user","search"],"host":["laravel-playground","local"],"query":[],"variable":[]}},"response":[],"_postman_id":"5e549e85-015d-4ef2-af01-4661949122c1"},{"name":"Advanced search using a range of numbers","id":"fc8ae5eb-3aa6-438c-a416-70c90ad870fb","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Accept","value":"application/json","type":"text"},{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"where\": [\n\t\t{\n\t\t\t\"id\": {\n\t\t\t\t\"from\": 1,\n\t\t\t\t\"to\": 10\n\t\t\t}\n\t\t}\n\t]\n}","options":{"raw":{"language":"json"}}},"url":"http://laravel-playground.local/api/user/search","description":"<p>For <code>numeric</code> columns, you can use <code>between</code> by specifying a <code>from</code> and <code>to</code>.</p>\n<h2 id=\"sql-query\">SQL Query:</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>select * from `users` where (`id` between 1 and 10) and `users`.`deleted_at` is null    \n</code></pre>","urlObject":{"protocol":"http","path":["api","user","search"],"host":["laravel-playground","local"],"query":[],"variable":[]}},"response":[],"_postman_id":"fc8ae5eb-3aa6-438c-a416-70c90ad870fb"},{"name":"Advanced search using less than a given date","id":"f1f689d1-f9b9-45a7-b2ae-3ebd9ac62014","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"},{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"where\": [\n\t\t{\n\t\t\t\"email_verified_at\": {\n\t\t\t\t\"lessThan\": \"2020-01-01 00:00:00\"\n\t\t\t}\n\t\t}\n\t]\n}","options":{"raw":{"language":"json"}}},"url":"http://laravel-playground.local/api/user/search","description":"<p>For <code>date</code> columns, the values will be converted to a <code>Carbon</code> instance. If <code>lessThan</code> is specified, the query will use <code>&lt;</code>.</p>\n<h2 id=\"sql-query\">SQL Query:</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>select\n  *\nfrom\n  `users`\nwhere\n  (`email_verified_at` &lt; '2020-01-01 00:00:00')\n  and `users`.`deleted_at` is null\n</code></pre>","urlObject":{"protocol":"http","path":["api","user","search"],"host":["laravel-playground","local"],"query":[],"variable":[]}},"response":[],"_postman_id":"f1f689d1-f9b9-45a7-b2ae-3ebd9ac62014"},{"name":"Advanced search using less than or equal to a given date","id":"087b1ef5-425e-4fd4-b8a9-5a9a96f52e88","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"},{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"where\": [\n\t\t{\n\t\t\t\"email_verified_at\": {\n\t\t\t\t\"lessThanOrEqualTo\": \"2020-01-01\"\n\t\t\t}\n\t\t}\n\t],\n\t\"perPage\": 10\n}"},"url":"http://laravel-playground.local/api/user/search","description":"<p>For <code>date</code> columns, the values will be converted to a <code>Carbon</code> instance. If <code>lessThanOrEqualTo</code> is specified, the query will use <code>&lt;=</code>.</p>\n<h2 id=\"sql-query\">SQL Query:</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>select\n  *\nfrom\n  `users`\nwhere\n  (`email_verified_at` &lt;= '2020-01-01 00:00:00')\n  and `users`.`deleted_at` is null\nlimit\n  10 offset 0\n</code></pre>","urlObject":{"protocol":"http","path":["api","user","search"],"host":["laravel-playground","local"],"query":[],"variable":[]}},"response":[],"_postman_id":"087b1ef5-425e-4fd4-b8a9-5a9a96f52e88"},{"name":"Advanced search using greater than a given date","id":"4b7407e8-3592-4b6d-b4c8-4a9ae9e2e4d1","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"},{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"where\": [\n\t\t{\n\t\t\t\"email_verified_at\": {\n\t\t\t\t\"greaterThan\": \"2020-01-01\"\n\t\t\t}\n\t\t}\n\t],\n\t\"perPage\": 10\n}","options":{"raw":{"language":"json"}}},"url":"http://laravel-playground.local/api/user/search","description":"<p>For <code>date</code> columns, the values will be converted to a <code>Carbon</code> instance. If <code>greaterThan</code> is specified, the query will use <code>&gt;</code>.</p>\n<h2 id=\"sql-query\">SQL Query:</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>select\n  *\nfrom\n  `users`\nwhere\n  (`email_verified_at` &gt; '2020-01-01 00:00:00')\n  and `users`.`deleted_at` is null\nlimit\n  10 offset 0\n</code></pre>","urlObject":{"protocol":"http","path":["api","user","search"],"host":["laravel-playground","local"],"query":[],"variable":[]}},"response":[],"_postman_id":"4b7407e8-3592-4b6d-b4c8-4a9ae9e2e4d1"},{"name":"Advanced search using greater than or equal to a given date","id":"421d4ce5-9b73-4d0d-9348-294ae05e2f38","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","type":"text","value":"application/json"},{"key":"Accept","type":"text","value":"application/json"}],"body":{"mode":"raw","raw":"{\n\t\"where\": [\n\t\t{\n\t\t\t\"email_verified_at\": {\n\t\t\t\t\"greaterThanOrEqualTo\": \"2020-01-01\"\n\t\t\t}\n\t\t}\n\t],\n\t\"perPage\": 10\n}","options":{"raw":{"language":"json"}}},"url":"http://laravel-playground.local/api/user/search","description":"<p>For <code>date</code> columns, the values will be converted to a <code>Carbon</code> instance. If <code>greaterThanOrEqualTo</code> is specified, the query will use <code>&gt;=</code>.</p>\n<h2 id=\"sql-query\">SQL Query:</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>select\n  *\nfrom\n  `users`\nwhere\n  (`email_verified_at` &gt;= '2020-01-01 00:00:00')\n  and `users`.`deleted_at` is null\nlimit\n  10 offset 0\n</code></pre>","urlObject":{"protocol":"http","path":["api","user","search"],"host":["laravel-playground","local"],"query":[],"variable":[]}},"response":[],"_postman_id":"421d4ce5-9b73-4d0d-9348-294ae05e2f38"},{"name":"Advanced search using a range of dates","id":"3f4e3056-e00b-4ead-8424-5bdf0bd4c960","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"},{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"where\": [\n\t\t{\n\t\t\t\"email_verified_at\": {\n\t\t\t\t\"from\": \"2019-01-01\",\n\t\t\t\t\"to\": \"2020-01-01\"\n\t\t\t}\n\t\t}\n\t],\n\t\"perPage\": 10\n}","options":{"raw":{"language":"json"}}},"url":"http://laravel-playground.local/api/user/search","description":"<p>For <code>date</code> columns, the values will be converted to a <code>Carbon</code> instance. You can use <code>between</code> by specifying a <code>from</code> and <code>to</code>.</p>\n<h2 id=\"sql-query\">SQL Query:</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>select\n  *\nfrom\n  `users`\nwhere\n  (\n    `email_verified_at` between '2019-01-01 00:00:00'\n    and '2020-01-01 00:00:00'\n  )\n  and `users`.`deleted_at` is null\nlimit\n  10 offset 0\n</code></pre>","urlObject":{"protocol":"http","path":["api","user","search"],"host":["laravel-playground","local"],"query":[],"variable":[]}},"response":[],"_postman_id":"3f4e3056-e00b-4ead-8424-5bdf0bd4c960"},{"name":"Advanced search where field is null","id":"9ae14969-1cdc-4829-94ef-f72e6776ebb7","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"},{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"where\": [\n\t\t{\n\t\t\t\"email_verified_at\": {\n\t\t\t\t\"null\": true\n\t\t\t}\n\t\t}\n\t],\n\t\"first\": true\n}","options":{"raw":{"language":"json"}}},"url":"http://laravel-playground.local/api/user/search","description":"<p>If <code>null</code> is set to true in a column, it will use an <code>is null</code> query.</p>\n<h2 id=\"sql-query\">SQL Query:</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>select * from `users` where (`email_verified_at` is null) and `users`.`deleted_at` is null limit 1 \n</code></pre>","urlObject":{"protocol":"http","path":["api","user","search"],"host":["laravel-playground","local"],"query":[],"variable":[]}},"response":[],"_postman_id":"9ae14969-1cdc-4829-94ef-f72e6776ebb7"},{"name":"Advanced search where field is not null","id":"d99096c3-362e-411e-b990-30dc4af997b3","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"},{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"where\": [\n\t\t{\n\t\t\t\"email_verified_at\": {\n\t\t\t\t\"null\": false\n\t\t\t}\n\t\t}\n\t],\n\t\"first\": true\n}","options":{"raw":{"language":"json"}}},"url":"http://laravel-playground.local/api/user/search","description":"<p>If <code>null</code> is set to false in a column, it will use an <code>is not null</code> query.</p>\n<h2 id=\"sql-query\">SQL Query:</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>select\n  *\nfrom\n  `users`\nwhere\n  (`email_verified_at` is not null)\n  and `users`.`deleted_at` is null\nlimit\n  1\n</code></pre>","urlObject":{"protocol":"http","path":["api","user","search"],"host":["laravel-playground","local"],"query":[],"variable":[]}},"response":[],"_postman_id":"d99096c3-362e-411e-b990-30dc4af997b3"},{"name":"Advanced search using a multiple conditions","id":"f6422555-e885-48dd-937f-fc03393751bb","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"},{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"where\": [\n\t\t{\n\t\t\t\"name\": \"Mr.\",\n\t\t\t\"email\": \"%@example.net\"\n\t\t},\n\t\t{\n\t\t\t\"email_verified_at\": {\n\t\t\t\t\"null\": true\n\t\t\t}\n\t\t}\n\t],\n\t\"perPage\": 10\n}","options":{"raw":{"language":"json"}}},"url":"http://laravel-playground.local/api/user/search","description":"<p>To set multiple conditions, just add another object in the <code>where</code> array. Each item will be evaluated in a separate closure.</p>\n<h2 id=\"sql-query\">SQL Query:</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>select\n  *\nfrom\n  `users`\nwhere\n  (\n    `name` like 'Mr.%'\n    or `email` like '%@example.net%'\n  )\n  and (`email_verified_at` is null)\n  and `users`.`deleted_at` is null\nlimit\n  10 offset 0\n</code></pre>","urlObject":{"protocol":"http","path":["api","user","search"],"host":["laravel-playground","local"],"query":[],"variable":[]}},"response":[],"_postman_id":"f6422555-e885-48dd-937f-fc03393751bb"},{"name":"Advanced search using a multiple strict conditions","id":"656ef106-b749-4c91-99da-cb11debb897f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"},{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"where\": [\n\t\t{\n\t\t\t\"name\": \"Mr.\",\n\t\t\t\"email\": \"%@example.net\",\n\t\t\t\"strict\": true\n\t\t},\n\t\t{\n\t\t\t\"email_verified_at\": {\n\t\t\t\t\"null\": false\n\t\t\t}\n\t\t}\n\t],\n\t\"perPage\": 10\n}","options":{"raw":{"language":"json"}}},"url":"http://laravel-playground.local/api/user/search","description":"<p>To set the conditions inside a closure to only use <code>and</code>, you need to set <code>strict</code> to true in the item.</p>\n<h2 id=\"sql-query\">SQL Query:</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>select\n  *\nfrom\n  `users`\nwhere\n  (\n    `name` like 'Mr.%'\n    and `email` like '%@example.net%'\n  )\n  and (`email_verified_at` is not null)\n  and `users`.`deleted_at` is null\nlimit\n  10 offset 0\n</code></pre>","urlObject":{"protocol":"http","path":["api","user","search"],"host":["laravel-playground","local"],"query":[],"variable":[]}},"response":[],"_postman_id":"656ef106-b749-4c91-99da-cb11debb897f"},{"name":"Advanced search but inverse result","id":"dc4aaa96-c432-4baf-9723-93250d137987","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"},{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"where\": [\n\t\t{\n\t\t\t\"name\": \"Mr.\",\n\t\t\t\"inverse\": true\n\t\t},\n\t\t{\n\t\t\t\"email_verified_at\": {\n\t\t\t\t\"null\": true\n\t\t\t}\n\t\t}\n\t],\n\t\"perPage\": 10\n}","options":{"raw":{"language":"json"}}},"url":"http://laravel-playground.local/api/user/search","description":"<p>If <code>inverse</code> is specified, if will do the opposite of the parameters.</p>\n<h2 id=\"sql-query\">SQL Query</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>select\n  *\nfrom\n  `users`\nwhere\n  (`name` not like 'Mr.%')\n  and (`email_verified_at` is null)\n  and `users`.`deleted_at` is null\nlimit\n  10 offset 0\n</code></pre>","urlObject":{"protocol":"http","path":["api","user","search"],"host":["laravel-playground","local"],"query":[],"variable":[]}},"response":[],"_postman_id":"dc4aaa96-c432-4baf-9723-93250d137987"},{"name":"Advanced search with filtered related data","id":"eeba1732-b04c-485f-954b-5e845596572f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"},{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"where\": [\n\t\t{\n\t\t\t\"name\": \"Mr.\"\n\t\t}\n\t],\n\t\"with\": [\n\t\t{\n\t\t\t\"relationship\": \"posts\",\n\t\t\t\"where\": [\n\t\t\t\t{\n\t\t\t\t\t\"published_at\": {\n\t\t\t\t\t\t\"null\": true\n\t\t\t\t\t},\n\t\t\t\t\t\"strict\": true\n\t\t\t\t}\t\n\t\t\t]\n\t\t}\n\t],\n\t\"perPage\": 10\n}","options":{"raw":{"language":"json"}}},"url":"http://laravel-playground.local/api/user/search","description":"<p>To filter related data results, you can add <code>where</code> in the <code>with</code> array.</p>\n<h2 id=\"sql-query---user-table\">SQL Query - User Table:</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>select * from `users` where (`name` like 'Mr.%') and `users`.`deleted_at` is null limit 10 offset 0\n</code></pre><h2 id=\"sql-query---post-table-related-data\">SQL Query - Post Table (related data):</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>select * from `posts` where `posts`.`user_id` in (5, 7, 63) and `published_at` is null\n</code></pre>","urlObject":{"protocol":"http","path":["api","user","search"],"host":["laravel-playground","local"],"query":[],"variable":[]}},"response":[],"_postman_id":"eeba1732-b04c-485f-954b-5e845596572f"},{"name":"Advanced search with filtered related data count","id":"ce870f92-cce9-4ac3-9234-d043a0899612","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"},{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"where\": [\n\t\t{\n\t\t\t\"name\": \"Mr.\"\n\t\t}\n\t],\n\t\"withCount\": [\n\t\t{\n\t\t\t\"relationship\": \"posts\",\n\t\t\t\"where\": [\n\t\t\t\t{\n\t\t\t\t\t\"published_at\": {\n\t\t\t\t\t\t\"null\": true\n\t\t\t\t\t},\n\t\t\t\t\t\"strict\": true\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t],\n\t\"perPage\": 10\n}","options":{"raw":{"language":"json"}}},"url":"http://laravel-playground.local/api/user/search","description":"<p>To count filtered related data, use <code>withCount</code> instead of <code>with</code>.</p>\n<h2 id=\"sql-query\">SQL Query:</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>select\n  `users`.*,\n  (\n    select\n      count(*)\n    from\n      `posts`\n    where\n      `users`.`id` = `posts`.`user_id`\n      and `published_at` is null\n  ) as `posts_count`\nfrom\n  `users`\nwhere\n  (`name` like 'Mr.%')\n  and `users`.`deleted_at` is null\nlimit\n  10 offset 0\n</code></pre>","urlObject":{"protocol":"http","path":["api","user","search"],"host":["laravel-playground","local"],"query":[],"variable":[]}},"response":[],"_postman_id":"ce870f92-cce9-4ac3-9234-d043a0899612"},{"name":"Advanced search with relationship existence","id":"07f4a00e-1ed3-4fc2-92f0-8c63003cf239","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","type":"text","value":"application/json"},{"key":"Accept","type":"text","value":"application/json"}],"body":{"mode":"raw","raw":"{\n\t\"has\": [\"posts\"],\n\t\"with\": [\n\t\t{\n\t\t\t\"relationship\": \"posts\",\n\t\t\t\"where\": [\n\t\t\t\t{\n\t\t\t\t\t\"published_at\": {\n\t\t\t\t\t\t\"null\": true\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t]\n\t\t}\n\t],\n\t\"first\": true\n}","options":{"raw":{"language":"json"}}},"url":"http://laravel-playground.local/api/user/search","description":"<p>To check if a relationship exists between models, you can use <code>has</code>.</p>\n<h2 id=\"sql-query---check-existence\">SQL Query - check existence</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>select\n  *\nfrom\n  `users`\nwhere\n  exists (\n    select\n      *\n    from\n      `posts`\n    where\n      `users`.`id` = `posts`.`user_id`\n  )\n  and `users`.`deleted_at` is null\nlimit\n  1\n</code></pre><h2 id=\"sql-query---results-from-existence\">SQL Query - results from existence</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>select * from `posts` where `posts`.`user_id` in (2) or `published_at` is null  \n</code></pre>","urlObject":{"protocol":"http","path":["api","user","search"],"host":["laravel-playground","local"],"query":[],"variable":[]}},"response":[],"_postman_id":"07f4a00e-1ed3-4fc2-92f0-8c63003cf239"},{"name":"Advanced search with relationship existence constraints","id":"dfb9b192-f972-46b7-a4c8-5208e9592d6d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","type":"text","value":"application/json"},{"key":"Accept","type":"text","value":"application/json"}],"body":{"mode":"raw","raw":"{\n\t\"has\": [\n        [\n            {\n                \"conditions\": [ \n                    {\n                        \"relationship\": \"posts\",\n                        \"greaterThan\": 1\n                    }\n                ]\n            }\n        ]\n\t],\n\t\"with\": [\n\t\t{\n\t\t\t\"relationship\": \"posts\",\n\t\t\t\"where\": [\n\t\t\t\t{\n\t\t\t\t\t\"published_at\": {\n\t\t\t\t\t\t\"null\": true\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t]\n\t\t}\n\t],\n\t\"first\": true\n}","options":{"raw":{"language":"json"}}},"url":"http://laravel-playground.local/api/user/search","description":"<p>You can add constraints in the <code>has</code> array</p>\n<ul>\n<li><code>greaterThan</code></li>\n<li><code>greaterThanOrEqualTo</code></li>\n<li><code>lessThan</code></li>\n<li><code>lessThanOrEqualTo</code></li>\n<li><code>where</code></li>\n</ul>\n<h2 id=\"sql-query---existence-check\">SQL Query - existence check:</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>select\n  *\nfrom\n  `users`\nwhere\n  (\n    select\n      count(*)\n    from\n      `posts`\n    where\n      `users`.`id` = `posts`.`user_id`\n  ) &gt; 1\n  and `users`.`deleted_at` is null\nlimit\n  1\n</code></pre><h2 id=\"sql-query\">SQL Query:</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>select\n  *\nfrom\n  `posts`\nwhere\n  `posts`.`user_id` in (3)\n  or `published_at` is null\n</code></pre>","urlObject":{"protocol":"http","path":["api","user","search"],"host":["laravel-playground","local"],"query":[],"variable":[]}},"response":[],"_postman_id":"dfb9b192-f972-46b7-a4c8-5208e9592d6d"},{"name":"Advanced search with relationship absence","id":"ac9d538a-a4f3-47ab-b0a3-eacd3744ca2c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"},{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"where\":[\n\t\t{\n\t\t\t\"name\": \"Mr.\"\n\t\t}\t\n\t],\n\t\"doesntHave\": [\"posts\"],\n\t\"perPage\": 10\n}"},"url":"http://laravel-playground.local/api/user/search","description":"<p>To check if a relationship is absent between models, use <code>doesntHave</code></p>\n<h2 id=\"sql-query\">SQL Query:</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>select * from `users` where (`name` like 'Mr.%') and `users`.`deleted_at` is null limit 10 offset 0    \n</code></pre>","urlObject":{"protocol":"http","path":["api","user","search"],"host":["laravel-playground","local"],"query":[],"variable":[]}},"response":[],"_postman_id":"ac9d538a-a4f3-47ab-b0a3-eacd3744ca2c"},{"name":"Advanced search with relationship absence constraints","id":"233e01fa-1828-47b5-a0d2-66b9d07a8753","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"},{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"where\":[\n\t\t{\n\t\t\t\"name\": \"Mr.\"\n\t\t}\t\n\t],\n\t\"doesntHave\": [\n        [\n            {\n                \"conditions\": [\n                    {\n                        \"relationship\": \"posts\",\n                        \"where\": [\n                            {\n                                \"published_at\": {\n                                    \"null\": true\n                                },\n                                \"strict\": true\n                            }\n                        ]\n                    }\n                ]\n            }\n        ]\n\t],\n\t\"perPage\": 10\n}","options":{"raw":{"language":"json"}}},"url":"http://laravel-playground.local/api/user/search","description":"<p>You can add constraints in the <code>doesntHave</code> array using <code>where</code></p>\n<h2 id=\"sql-query\">SQL Query:</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>select\n  *\nfrom\n  `users`\nwhere\n  (`name` like 'Mr.%')\n  and not exists (\n    select\n      *\n    from\n      `posts`\n    where\n      `users`.`id` = `posts`.`user_id`\n      and `published_at` is null\n  )\n  and `users`.`deleted_at` is null\nlimit\n  10 offset 0\n</code></pre>","urlObject":{"protocol":"http","path":["api","user","search"],"host":["laravel-playground","local"],"query":[],"variable":[]}},"response":[],"_postman_id":"233e01fa-1828-47b5-a0d2-66b9d07a8753"},{"name":"Advanced search multiple sort","id":"51b4eda7-f76c-4ac2-85c4-8c5f6a94a3c5","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"},{"key":"Accept","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"has\": [\n        [\n            {\n                \"conditions\": [\n                    {\n                        \"relationship\": \"posts\",\n                        \"greaterThan\": 1\n                    }\n                ]\n            }\n        ]\n\t],\n\t\"with\": [\n\t\t{\n\t\t\t\"relationship\": \"posts\",\n\t\t\t\"where\": [\n\t\t\t\t{\n\t\t\t\t\t\"published_at\": {\n\t\t\t\t\t\t\"null\": true\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t],\n\t\t\t\"orderBy\": [\n\t\t\t\t{\n\t\t\t\t\t\"column\": \"published_at\",\n\t\t\t\t\t\"descending\": true\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t],\n\t\"orderBy\": [\n\t\t{\n\t\t\t\"column\": \"name\"\n\t\t},\n\t\t{\n\t\t\t\"column\": \"email\",\n\t\t\t\"descending\": true\n\t\t}\n\t],\n\t\"perPage\": 10\n}","options":{"raw":{"language":"json"}}},"url":"http://laravel-playground.local/api/user/search","description":"<p>You can add multiple sort by setting the <code>orderBy</code> as an array and having an object with <code>column</code> and <code>descending</code> property.</p>\n<h2 id=\"sql-query---existence-check\">SQL Query - existence check:</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>select\n  *\nfrom\n  `users`\nwhere\n  (\n    select\n      count(*)\n    from\n      `posts`\n    where\n      `users`.`id` = `posts`.`user_id`\n  ) &gt; 1\n  and `users`.`deleted_at` is null\norder by\n  `name` asc,\n  `email` desc\nlimit\n  10 offset 0\n</code></pre><h2 id=\"sql-query---users-table-with-sorting\">SQL Query - Users Table with sorting</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>select\n  *\nfrom\n  `posts`\nwhere\n  `posts`.`user_id` in (14, 18, 20, 24, 31, 33, 48, 85, 97, 100)\n  or `published_at` is null\n</code></pre>","urlObject":{"protocol":"http","path":["api","user","search"],"host":["laravel-playground","local"],"query":[],"variable":[]}},"response":[],"_postman_id":"51b4eda7-f76c-4ac2-85c4-8c5f6a94a3c5"}],"id":"17a46a64-1b1b-4882-b4da-39a167d63617","description":"<p>Advance search enables the client to have more control on how to search in our API. This endpoint is accessible using a <code>POST</code> request only, since the client should pass a nested <code>JSON</code> request.</p>\n<p>Each item in the <code>where</code> array will be a single closure. This means that you can group a set of properties that may use <code>or</code> and the other group may use <code>and</code>. Not unlike the <code>Simple Search</code> which only has a single <code>where</code> clause in its query. </p>\n","event":[{"listen":"prerequest","script":{"id":"7c38651f-cd8c-4675-a43b-3495f1379c5e","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"56a389bd-b8d5-4884-9eee-f79b7ed12f2e","type":"text/javascript","exec":[""]}}],"_postman_id":"17a46a64-1b1b-4882-b4da-39a167d63617"}],"event":[{"listen":"prerequest","script":{"id":"df8dfca3-cfce-44e1-aa11-9b6977afa585","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"d12c7e98-b5d1-4620-aa86-2f4e76f37319","type":"text/javascript","exec":[""]}}]}