{"id":34016404,"url":"https://github.com/socialblue/laravel-query-adviser","last_synced_at":"2025-12-13T14:02:14.489Z","repository":{"id":34649002,"uuid":"182065746","full_name":"socialblue/laravel-query-adviser","owner":"socialblue","description":"With Laravel Query Adviser you can get more insights into the SQL queries created by Eloquent models used in your app. It logs the queries used by your application and provides a helpful overview of the SQL queries. You can rerun the SQL query to analyze the database impact or copy the SQL query to your clipboard.","archived":false,"fork":false,"pushed_at":"2024-12-13T05:09:30.000Z","size":5807,"stargazers_count":20,"open_issues_count":4,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-22T05:21:09.814Z","etag":null,"topics":["advisor","database","eloquent","insights","laravel","mssql","mysql","optimization","performance","performance-analysis","postgresql","query-optimization","sql","testing"],"latest_commit_sha":null,"homepage":"","language":"Vue","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/socialblue.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2019-04-18T10:16:02.000Z","updated_at":"2025-10-14T14:27:53.000Z","dependencies_parsed_at":"2023-02-18T18:01:04.801Z","dependency_job_id":"9d31c8a7-85c2-4687-a1fd-d9ef955bbada","html_url":"https://github.com/socialblue/laravel-query-adviser","commit_stats":{"total_commits":253,"total_committers":4,"mean_commits":63.25,"dds":0.07509881422924902,"last_synced_commit":"8dc36379d5c638bcd572109f66faa844dde613e9"},"previous_names":[],"tags_count":62,"template":false,"template_full_name":null,"purl":"pkg:github/socialblue/laravel-query-adviser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socialblue%2Flaravel-query-adviser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socialblue%2Flaravel-query-adviser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socialblue%2Flaravel-query-adviser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socialblue%2Flaravel-query-adviser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/socialblue","download_url":"https://codeload.github.com/socialblue/laravel-query-adviser/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socialblue%2Flaravel-query-adviser/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27706746,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-13T02:00:09.769Z","response_time":147,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["advisor","database","eloquent","insights","laravel","mssql","mysql","optimization","performance","performance-analysis","postgresql","query-optimization","sql","testing"],"created_at":"2025-12-13T14:01:18.655Z","updated_at":"2025-12-13T14:02:14.483Z","avatar_url":"https://github.com/socialblue.png","language":"Vue","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel-Query-Adviser\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/socialblue/laravel-query-adviser.svg?style=flat-square)](https://packagist.org/packages/socialblue/laravel-query-adviser)\n[![Quality Score](https://img.shields.io/scrutinizer/g/socialblue/laravel-query-adviser.svg?style=flat-square)](https://scrutinizer-ci.com/g/socialblue/laravel-query-adviser)\n[![Total Downloads](https://img.shields.io/packagist/dt/socialblue/laravel-query-adviser.svg?style=flat-square)](https://packagist.org/packages/socialblue/laravel-query-adviser)\n\n\u003ctable\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003cimg src=\"./public/images/favicon.svg\" width=\"180\" /\u003e\u003c/td\u003e\n        \u003ctd\u003eWith Laravel Query Adviser you can get more insights into the SQL queries created by Eloquent models used in your app.\nIt logs the queries used by your application and provides a helpful overview of the SQL queries. You can rerun the SQL query to analyze the database impact or copy the SQL query to your clipboard.\nThe handy card view allows you to quickly point out the pain points of your application's SQL queries.\u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\n\n## Features\n\n| Query Logging    | Web app           | Chrome DevTool            | Code                      |\n|------------------|-------------------|---------------------------|---------------------------|\n| Use cache driver |                   |                           |                           |\n| Eloquent Queries |                   |                           |                           |\n| Routes           |                   |                           |                           |\n| Stack trace      |                   |                           |                           |\n| Tinker Support   |                   |                           |                           |\n| Job Support      |                   |                           |                           |\n| MySql Support    |                   |                           |                           |\n|                  | Start session     | Start Session             |                           |\n|                  | Stop session      | Stop Session              |                           |\n|                  | Export Session    |                           |                           |\n|                  | Import Session    |                           |                           |\n|                  | Query Grouping    |                           |                           |\n|                  | Query Ordering    |                           |                           |\n|                  | Explain Query     |                           |                           |\n|                  | Re-execute Query  |                           |                           |\n|                  | Copy to clipboard |                           |                           |\n|                  |                   | Show realtime query usage |                           |\n|                  |                   |                           | dd query builder query    |\n|                  |                   |                           | dump query builder query  |\n|                  |                   |                           | dd eloquent model query   |\n|                  |                   |                           | dump eloquent model query |\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require socialblue/laravel-query-adviser --dev\n```\n\nPublish Laravel-Query-Adviser \n\n```bash\nphp artisan vendor:publish --provider=\"Socialblue\\LaravelQueryAdviser\\LaravelQueryAdviserServiceProvider\"\n```\n\n**Publish the front-end application after updating**\n\n```bash\nphp artisan vendor:publish --tag=public --force\n```\n\n**When updating from `0.13.2` to `0.14.0` please use**\n\n```bash\nphp artisan vendor:publish --provider=\"Socialblue\\LaravelQueryAdviser\\LaravelQueryAdviserServiceProvider\" --force\n```\n\n## Install Chrome developer tool\nWhen you want to be able to start and stop the log sessions and see realtime query information from your current browser tab.\nYou can install the Chrome developer tool in the\n[Chrome web store](https://chrome.google.com/webstore/detail/laravel-query-adviser/dgojkgibloeebbjieckfjaflodkamdbf).\n\n![Extension](./img/chrome-developer-tool.png)\n\n## Usage\n\n### Output queries inline\n\u003e Dump and die\n\u003e ``` php\n\u003e User::join('posts', 'posts.users_id', '=', 'users.id')\n\u003e -\u003eselect([DB::raw('SUM(posts.id)')])\n\u003e -\u003ewhere('users.id', 1)\n\u003e -\u003eselect([DB::raw('SUM(post.id)')])-\u003eqadd();\n\u003e ```\n\u003e or just dump\n\u003e ``` php\n\u003e \n\u003e User::join('posts', 'posts.users_id', '=', 'users.id')\n\u003e -\u003eselect([DB::raw('SUM(posts.id)')])\n\u003e -\u003ewhere('users.id', 1)\n\u003e -\u003eselect([DB::raw('SUM(post.id)')])-\u003eqadump();\n\u003e\n\u003e ```\n\u003e both dump this array\n\u003e\n\u003e ```php\n\u003e [\n\u003e    'toSql' =\u003e 'select sum(posts.id) from users join posts on posts.users_id = users.id where users.id = ?'\n\u003e    'bindings' =\u003e [1]\n\u003e    'query' =\u003e 'select sum(posts.id) from users join posts on posts.users_id = users.id where users.id = 1'\n\u003e ]\n\u003e ```\n\n### Start query logging session\n\n1. To start a query log session goto {app_url}/query-adviser/\n2. Press play and open the pages of your app you want to log the queries of\n3. Stop the session and click on the session bar to see all the details.\n\n\u003e #### Session stepper\n\u003e ![Query Overview](./img/stepper.png)\n\n\u003e #### Session list\n\u003e ![Query Overview](./img/session-list.png)\n\n### Brows through session overview\n\n\u003e #### Query time-line\n\u003e *collapse and expand the panels for less or more information about the queries executed in that time frame.*\n\u003e ![Query Overview](./img/overview.png)\n\n#### Groups\nYou can group the queries by time, routes and rawQuery.\nAlso you can clear the cached queries by pressing the eject button.\n\u003e *group by time, routes, referer, raw queries, queries with bindings, and query time*\n![Query groups](img/group-by-new.png)\n\n#### Sort\n\u003e *Sort the time line by last inserted, slowest query, and most occurrences*\n![Query Card](./img/sorting.png)\n\n#### Query card\n\u003e *Re-execute a query, get query information, and copy the query to your clipboard*\n![Query Card](./img/card.png)\n\n#### Query labels\nAs of version 0.10.0, the query card has labels related to the class,\nfile and function of the query executed from your app folder.\n\n\u003e *File Information*\n\u003e ![Query labels](./img/labels.png)\n\nOpen the explain dialog to see more information about the query.\n\n\u003e *Query information*\n\u003e ![Query Card](./img/query-information.png)\n\n\u003e *Re-execute Query*\n\u003e ![Query Card](./img/query-execute.png)\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 mark.broersen@outlook.com instead of using the issue tracker.\n\n## Credits\n\n- [Mark](https://github.com/socialblue)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n\n## Laravel Package Boilerplate\n\nThis package was generated using the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsocialblue%2Flaravel-query-adviser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsocialblue%2Flaravel-query-adviser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsocialblue%2Flaravel-query-adviser/lists"}