{"id":20811205,"url":"https://github.com/shirokovnv/laravel-query-api-frontend","last_synced_at":"2026-04-26T08:32:28.434Z","repository":{"id":103423408,"uuid":"335028898","full_name":"shirokovnv/laravel-query-api-frontend","owner":"shirokovnv","description":"The package for writing beautiful eloquent style queries in frontend","archived":false,"fork":false,"pushed_at":"2021-05-02T06:48:32.000Z","size":102,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-02T10:53:32.156Z","etag":null,"topics":["api","eloquent","frontend","laravel","package","query"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/shirokovnv.png","metadata":{"files":{"readme":"readme.md","changelog":"changelog.md","contributing":null,"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,"zenodo":null}},"created_at":"2021-02-01T17:27:53.000Z","updated_at":"2023-09-18T04:43:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"32662694-2103-43ea-8041-0a6734d629ed","html_url":"https://github.com/shirokovnv/laravel-query-api-frontend","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/shirokovnv/laravel-query-api-frontend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shirokovnv%2Flaravel-query-api-frontend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shirokovnv%2Flaravel-query-api-frontend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shirokovnv%2Flaravel-query-api-frontend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shirokovnv%2Flaravel-query-api-frontend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shirokovnv","download_url":"https://codeload.github.com/shirokovnv/laravel-query-api-frontend/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shirokovnv%2Flaravel-query-api-frontend/sbom","scorecard":{"id":819547,"data":{"date":"2025-08-11","repo":{"name":"github.com/shirokovnv/laravel-query-api-frontend","commit":"3ea0f3e70408bd873a22250e166e54733e9d3789"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/29 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: license.md:0","Info: FSF or OSI recognized license: MIT License: license.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"26 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T15:05:24.014Z","repository_id":103423408,"created_at":"2025-08-23T15:05:24.014Z","updated_at":"2025-08-23T15:05:24.014Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32290500,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T08:29:33.829Z","status":"ssl_error","status_checked_at":"2026-04-26T08:29:18.366Z","response_time":129,"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":["api","eloquent","frontend","laravel","package","query"],"created_at":"2024-11-17T20:37:51.631Z","updated_at":"2026-04-26T08:32:28.428Z","avatar_url":"https://github.com/shirokovnv.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel Query API Frontend\r\n\r\nThe package for writing beautiful eloquent style queries in frontend\r\n\r\nFor backend usage see [this package](https://github.com/shirokovnv/laravel-query-api-backend)\r\n\r\n## Installation\r\n\r\nVia npm: \r\n\r\n```bash\r\nnpm i laravel-query-api-frontend\r\n```\r\n\r\n## Usage\r\n\r\n1. Import query builder:\r\n\r\n```js\r\nimport { QueryBuilder } from 'laravel-query-api-frontend'\r\n```\r\n\r\n2. Write a query in laravel eloquent builder style, for ex.: \r\n\r\n```js\r\nconst query = QueryBuilder.fetch('App\\\\Post', 'post')\r\n  .where(['id', '\u003e', '10'])\r\n  .whereHas('author', function(query) {\r\n    return query.where('name', 'LIKE', '%John%');\r\n  })\r\n  .paginate(1, 10);\r\n```\r\n\r\nThis query assumes to select all posts with ID \u003e 10, where author name contains \"John\", \r\npaginated for 10 elements per page and returns page number 1\r\n\r\n3. Render the query to json: \r\n\r\n```js\r\nconst jsonQueryData = query.render();\r\n```\r\n\r\nThis will return something like this: \r\n\r\n```json\r\n{\r\n    \"query\": \"fetch\",\r\n    \"key\": \"post\",\r\n    \"type\": \"App\\\\Post\",\r\n    \"params\": {\r\n        \"per_page\": 10,\r\n        \"page\": 1,\r\n        \"parts\": [\r\n            {\r\n                \"kind\": \"where\",\r\n                \"args\": {\r\n                    \"params\": [\r\n                        \"id\",\r\n                        \"=\",\r\n                        1\r\n                    ]\r\n                }\r\n            },\r\n            {\r\n                \"kind\": \"whereHas\",\r\n                \"args\": {\r\n                    \"relation\": \"author\",\r\n                    \"subquery\": {\r\n                        \"query\": \"fetch\",\r\n                        \"key\": \"k6o7daqzwcrkktkvltx\",\r\n                        \"type\": \"author\",\r\n                        \"params\": {\r\n                            \"parts\": [\r\n                                {\r\n                                    \"kind\": \"where\",\r\n                                    \"args\": {\r\n                                        \"params\": \"name\"\r\n                                    }\r\n                                }\r\n                            ]\r\n                        }\r\n                    }\r\n                }\r\n            }\r\n        ]\r\n    }\r\n}\r\n```\r\n\r\n4. Send http request to your backend with jsonQueryData\r\n\r\n```js\r\nimport { QueryBuilder, QueryRunner, QueryResult } from 'laravel-query-api-frontend';\r\n\r\n/**\r\n * for \"http\" you can use axios instance\r\n * apiURL - your query backend endpoint \r\n */\r\nconst runner = new QueryRunner(http, apiURL);\r\nconst commentsQuery = QueryBuilder.fetch('App\\\\Comments', 'comments')\r\n  .where(['popular', '=', true])\r\n  .paginate(1, 10);\r\n\r\nrunner.addQuery(commentsQuery);\r\nrunner.runTransaction().then((result: QueryResult) =\u003e {\r\n  let comments = result.getContent('comments');\r\n  // do some stuff with received data \r\n\r\n})\r\n.catch((error: any) =\u003e {\r\n  // handle error\r\n});\r\n```\r\n\r\n### Available queries: \r\n\r\n\u003e create\r\n\r\n\u003e custom \r\n\r\n\u003e delete\r\n\r\n\u003e fetch \r\n\r\n\u003e find\r\n\r\n\u003e update\r\n\r\nYou can import query classes like this:\r\n\r\n```js\r\nimport { queries } from 'laravel-query-api-backend'\r\n```\r\n\r\nSupportable list of fetch conditions:\r\n\r\n\u003e where\r\n\r\n\u003e whereHas (orWhereHas)\r\n\r\n\u003e whereDoesntHave (orWhereDoesntHave)\r\n\r\n\u003e whereIn (whereNotIn)\r\n\r\n\u003e whereNull (orWhereNull)\r\n\r\n\u003e whereNotNull (orWhereNotNull)\r\n\r\n\u003e whereColumn\r\n\r\n\u003e whereExists\r\n\r\n\u003e limit \r\n\r\n\u003e offset\r\n\r\n\u003e scope \r\n\r\n\u003e with\r\n\r\nEnjoy!\r\n\r\n## Change log\r\n\r\nPlease see the [changelog](changelog.md) for more information on what has changed recently.\r\n\r\n## Testing\r\n\r\n```bash\r\nnpm run test\r\n```\r\n\r\n## Security\r\n\r\nIf you discover any security related issues, please email shirokovnv@gmail.com instead of using the issue tracker.\r\n\r\n## Credits\r\n\r\n- [Nickolai Shirokov][link-author]\r\n- [All Contributors][link-contributors]\r\n\r\n## License\r\n\r\nMIT. Please see the [license file](license.md) for more information.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshirokovnv%2Flaravel-query-api-frontend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshirokovnv%2Flaravel-query-api-frontend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshirokovnv%2Flaravel-query-api-frontend/lists"}