{"id":30110584,"url":"https://github.com/monoscope-tech/apitoolkit-laravel","last_synced_at":"2025-10-29T08:08:22.024Z","repository":{"id":41893413,"uuid":"477973482","full_name":"monoscope-tech/apitoolkit-laravel","owner":"monoscope-tech","description":"APItoolkit's Laravel (PHP) client SDK.","archived":false,"fork":false,"pushed_at":"2025-01-06T18:03:30.000Z","size":2553,"stargazers_count":4,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-20T08:00:52.801Z","etag":null,"topics":["apitoolkit","apitoolkit-sdk","laravel","php"],"latest_commit_sha":null,"homepage":"https://apitoolkit.io/docs/sdks/php/laravel/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/monoscope-tech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2022-04-05T04:25:08.000Z","updated_at":"2025-01-06T18:03:34.000Z","dependencies_parsed_at":"2024-07-10T10:30:59.430Z","dependency_job_id":"b1c0d99f-b9f2-48c9-80ad-6a8008747824","html_url":"https://github.com/monoscope-tech/apitoolkit-laravel","commit_stats":null,"previous_names":["monoscope-tech/apitoolkit-laravel"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/monoscope-tech/apitoolkit-laravel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monoscope-tech%2Fapitoolkit-laravel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monoscope-tech%2Fapitoolkit-laravel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monoscope-tech%2Fapitoolkit-laravel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monoscope-tech%2Fapitoolkit-laravel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/monoscope-tech","download_url":"https://codeload.github.com/monoscope-tech/apitoolkit-laravel/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monoscope-tech%2Fapitoolkit-laravel/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281584988,"owners_count":26526172,"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-10-29T02:00:06.901Z","response_time":59,"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":["apitoolkit","apitoolkit-sdk","laravel","php"],"created_at":"2025-08-10T04:47:41.380Z","updated_at":"2025-10-29T08:08:21.971Z","avatar_url":"https://github.com/monoscope-tech.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n![APItoolkit's Logo](https://github.com/apitoolkit/.github/blob/main/images/logo-white.svg?raw=true#gh-dark-mode-only)\n![APItoolkit's Logo](https://github.com/apitoolkit/.github/blob/main/images/logo-black.svg?raw=true#gh-light-mode-only)\n\n## Laravel SDK\n\n[![APItoolkit SDK](https://img.shields.io/badge/APItoolkit-SDK-0068ff?logo=laravel)](https://github.com/topics/apitoolkit-sdk) [![Join Discord Server](https://img.shields.io/badge/Chat-Discord-7289da)](https://apitoolkit.io/discord?utm_campaign=devrel\u0026utm_medium=github\u0026utm_source=sdks_readme) [![APItoolkit Docs](https://img.shields.io/badge/Read-Docs-0068ff)](https://apitoolkit.io/docs/sdks/php/laravel?utm_campaign=devrel\u0026utm_medium=github\u0026utm_source=sdks_readme)\n\nAPItoolkit is an end-to-end API and web services management toolkit for engineers and customer support teams. To integrate your Laravel (PHP) application with APItoolkit, you need to use this SDK to monitor incoming traffic, aggregate the requests, and then deliver them to the APItoolkit's servers.\n\n\u003c/div\u003e\n\n---\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Open Telemetry Configuration](#setup-opentelemetry)\n- [APItoolkit Middleware Setup](#setup-apitoolkit-middleware)\n- [Contributing and Help](#contributing-and-help)\n- [License](#license)\n\n---\n\n## Installation\n\nKindly run the command below to install the apitoolkit-laravel sdk and required otel packages:\n\n```sh\ncomposer require \\\n    open-telemetry/sdk \\\n    open-telemetry/exporter-otlp \\\n    apitoolkit/apitoolkit-laravel\n\n```\n\n## Setup Opentelemetry\n\n#### Installing opentelemetry extension\n\nAfter installing the necessary packages, you'll need to install the opentelemetry extention and add it to your `php.ini` file\n\n```sh\npecl install opentelemetry\n```\n\nThen add it to your `php.ini` file like so.\n\n```ini\n[opentelemetry]\nextension=opentelemetry.so\n```\n\nexport the following opentelemetry variables\n\n```sh\nexport OTEL_PHP_AUTOLOAD_ENABLED=true\nexport OTEL_SERVICE_NAME=your-service-name\nexport OTEL_TRACES_EXPORTER=otlp\nexport OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf\nexport OTEL_EXPORTER_OTLP_ENDPOINT=http://otelcol.apitoolkit.io:4318\nexport OTEL_RESOURCE_ATTRIBUTES=\"at-project-key={ENTER_YOUR_API_KEY_HERE}\"\nexport OTEL_PROPAGATORS=baggage,tracecontext\n```\n\n## Setup APItoolkit Middleware\n\nNext, register the middleware in the `app/Http/Kernel.php` file under the correct middleware group (e.g., `api`) or at the root, like so. This creates a customs spans which captures and sends http request info such as headers, requests and repsonse bodies, matched route etc. for each request\n\n```php\n\u003c?php\n\nnamespace App\\Http;\n\nuse Illuminate\\Foundation\\Http\\Kernel as HttpKernel;\n\nclass Kernel extends HttpKernel\n{\n    protected $middlewareGroups = [\n        'api' =\u003e [\n            // Other middleware here...\n            \\APIToolkit\\Http\\Middleware\\APIToolkit::class, // Initialize the APItoolkit client\n        ],\n    ];\n}\n```\n\nAlternatively, if you want to monitor specific routes, you can register the middleware, like so:\n\n```php\n\u003c?php\n\nnamespace App\\Http;\n\nuse Illuminate\\Foundation\\Http\\Kernel as HttpKernel;\n\nclass Kernel extends HttpKernel\n{\n    protected $routeMiddleware = [\n        // Other middleware here...\n        'apitoolkit' =\u003e \\APIToolkit\\Http\\Middleware\\APIToolkit::class,\n    ];\n}\n```\n\nThen you can use the `apitoolkit` middleware in your routes like so:\n\n```php\nRoute::get('/', function () {\n    return response()-\u003ejson([\n        'message' =\u003e 'Welcome to your new application!'\n    ]);\n})-\u003emiddleware('apitoolkit');\n```\n\n\u003e [!NOTE]\n\u003e\n\u003e The `{ENTER_YOUR_API_KEY_HERE}` demo string should be replaced with the [API key](https://apitoolkit.io/docs/dashboard/settings-pages/api-keys?utm_campaign=devrel\u0026utm_medium=github\u0026utm_source=sdks_readme) generated from the APItoolkit dashboard.\n\n\u003cbr /\u003e\n\n\u003e [!IMPORTANT]\n\u003e\n\u003e To learn more configuration options (redacting fields, error reporting, outgoing requests, etc.), please read this [SDK documentation](https://apitoolkit.io/docs/sdks/php/laravel?utm_campaign=devrel\u0026utm_medium=github\u0026utm_source=sdks_readme).\n\n## Contributing and Help\n\nTo contribute to the development of this SDK or request help from the community and our team, kindly do any of the following:\n\n- Read our [Contributors Guide](https://github.com/apitoolkit/.github/blob/main/CONTRIBUTING.md).\n- Join our community [Discord Server](https://apitoolkit.io/discord?utm_campaign=devrel\u0026utm_medium=github\u0026utm_source=sdks_readme).\n- Create a [new issue](https://github.com/apitoolkit/apitoolkit-laravel/issues/new/choose) in this repository.\n\n## License\n\nThis repository is published under the [MIT](LICENSE) license.\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\n\u003ca href=\"https://apitoolkit.io?utm_campaign=devrel\u0026utm_medium=github\u0026utm_source=sdks_readme\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\u003cimg src=\"https://github.com/apitoolkit/.github/blob/main/images/icon.png?raw=true\" width=\"40\" /\u003e\u003c/a\u003e\n\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonoscope-tech%2Fapitoolkit-laravel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmonoscope-tech%2Fapitoolkit-laravel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonoscope-tech%2Fapitoolkit-laravel/lists"}