{"id":37234382,"url":"https://github.com/loburets/laravel-query-printer","last_synced_at":"2026-01-15T03:58:51.481Z","repository":{"id":62518487,"uuid":"396382226","full_name":"loburets/laravel-query-printer","owner":"loburets","description":"An easy way to print queries in Laravel 🖨️","archived":false,"fork":false,"pushed_at":"2025-02-06T15:59:57.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-20T23:19:11.584Z","etag":null,"topics":["debug","debugging","laravel","php","sql"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/loburets.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}},"created_at":"2021-08-15T14:42:43.000Z","updated_at":"2025-02-06T16:00:01.000Z","dependencies_parsed_at":"2022-11-02T13:45:54.258Z","dependency_job_id":null,"html_url":"https://github.com/loburets/laravel-query-printer","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/loburets/laravel-query-printer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loburets%2Flaravel-query-printer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loburets%2Flaravel-query-printer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loburets%2Flaravel-query-printer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loburets%2Flaravel-query-printer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/loburets","download_url":"https://codeload.github.com/loburets/laravel-query-printer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loburets%2Flaravel-query-printer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28419274,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:47:48.104Z","status":"ssl_error","status_checked_at":"2026-01-14T10:46:19.031Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["debug","debugging","laravel","php","sql"],"created_at":"2026-01-15T03:58:50.832Z","updated_at":"2026-01-15T03:58:51.476Z","avatar_url":"https://github.com/loburets.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🖨️ Laravel Query Printer\n\nAn easy way to print Laravel queries\n\n## 📌 Example\n\n```PHP\n// Enable query log\n\\DB::enableQueryLog();\n\n// Use whatever queries you want to debug:\nUser::where('email', 'test@test.com')-\u003ewhere('verified', true)-\u003efirst();\nUser::where('id', '\u003c', '5')-\u003eget();\n\n// See what the queries were executed\n\\QueryPrinter::printQueryLog();\n```\n\n### 🔹 Output **without** this package:\n![Without Package](https://user-images.githubusercontent.com/5417461/130602821-0d93551d-71e7-44c7-b4ad-4f8af1c071f2.png)\n\n### 🔹 Output **with** this package:\n![With Package](https://user-images.githubusercontent.com/5417461/130602831-85a47a6c-fa2f-4115-ad1a-066efd03cbf1.png)\n\nNow you can simply copy and execute the query without struggling with bindings 🙌\n\n---\n\n## 🚀 Installation\n\n```Bash\ncomposer require loburets/laravel-query-printer\n```\n\nFor Laravel **\u003c 5.5**, add the alias in `config/app.php`:\n\n```PHP\n'QueryPrinter' =\u003e Loburets\\LaravelQueryPrinter\\Facade::class,\n```\n\n---\n\n## 🛠️ Usage\n\n### ✅ Printing a Query Builder instance\n\nYou can print a query before execution:\n\n```PHP\n    // Build your query, but don't call -\u003efirst(), -\u003eget() etc. So it is an instance of the Query Builder here:\n    $query = \\Model::where()-\u003ejoin()-\u003eetc();\n\n    // Print the generated SQL\n    \\QueryPrinter::print($query);\n```\n\n### ✅ Printing executed queries from query logs\n\nYou can also print queries after they have been executed:\n\n```PHP\n    // Enable the Query log:\n    \\DB::enableQueryLog();\n\n    // Do any actions which you want to be logged:\n    $results = \\Model::where()-\u003ejoin()-\u003eetc()-\u003eget();\n\n    // Print all the executed queries\n    \\QueryPrinter::printQueryLog();\n```\n\n---\n\nNow debugging Laravel queries is easier than ever! 🎯\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floburets%2Flaravel-query-printer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Floburets%2Flaravel-query-printer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floburets%2Flaravel-query-printer/lists"}