{"id":22491804,"url":"https://github.com/always-open/laravel-request-logger","last_synced_at":"2026-05-04T06:31:47.410Z","repository":{"id":62549238,"uuid":"483819037","full_name":"always-open/laravel-request-logger","owner":"always-open","description":"Log HTTP web requests made from your application","archived":false,"fork":false,"pushed_at":"2023-08-25T13:24:28.000Z","size":38,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-05T00:39:58.012Z","etag":null,"topics":["hacktoberfest","laravel","logger"],"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/always-open.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-04-20T21:30:01.000Z","updated_at":"2022-10-28T15:52:13.000Z","dependencies_parsed_at":"2024-12-06T18:11:31.961Z","dependency_job_id":"b5dda255-2198-4c5c-a499-722fd84987e4","html_url":"https://github.com/always-open/laravel-request-logger","commit_stats":{"total_commits":16,"total_committers":3,"mean_commits":5.333333333333333,"dds":0.1875,"last_synced_commit":"c16c45cce80c49f87329b61617b8fe0f86a3a454"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/always-open%2Flaravel-request-logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/always-open%2Flaravel-request-logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/always-open%2Flaravel-request-logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/always-open%2Flaravel-request-logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/always-open","download_url":"https://codeload.github.com/always-open/laravel-request-logger/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245917846,"owners_count":20693598,"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","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":["hacktoberfest","laravel","logger"],"created_at":"2024-12-06T18:11:15.988Z","updated_at":"2026-05-04T06:31:42.388Z","avatar_url":"https://github.com/always-open.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel Request Logger\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/always-open/laravel-request-logger.svg?style=flat-square)](https://packagist.org/packages/always-open/laravel-request-logger)\n[![Build Status](https://img.shields.io/github/workflow/status/always-open/laravel-request-logger/run-tests/main)](https://github.com/always-open/laravel-request-logger/actions?query=workflow%3Arun-tests)\n[![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/always-open/laravel-request-logger/PHPStan/main?label=PHPStan)](https://github.com/always-open/laravel-request-logger/actions?query=workflow%3APHPStan)\n[![Packagist Downloads](https://img.shields.io/packagist/dt/always-open/laravel-request-logger)](https://packagist.org/packages/always-open/laravel-request-logger)\n\n[![Maintainability](https://api.codeclimate.com/v1/badges/50523859ead2baf5d6af/maintainability)](https://codeclimate.com/github/always-open/laravel-request-logger/maintainability)\n\nWhen making HTTP requests to external APIs it is valuable to track each request and its response. This insight can help \nyou find issues, track usage, and reuse responses for testing/development.\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require always-open/laravel-request-logger\n```\n\n## Configuration\n\n``` php\nphp artisan vendor:publish --provider=\"\\AlwaysOpen\\RequestLogger\\RequestLoggerServiceProvider\"\n```\n\nRunning the above command will publish the config file.\n\n## Usage\n\n### Creation\nTo add logs to your system you must first create the migration and model for the appropriate log. This is done by using \nthe packages `request-logger:make-table` command.\n\nThe command needs the name of the item to be tracked and it will be used for naming the model and table.\n\n#### Example\n```shell\nphp artisan request-logger:make-table facebook\n```\nThis will create a model `\\App\\Models\\FacebookRequestLog` and a migration to create the table `facebook_request_logs`\n\n### Implementation\nThen you can use that model to create logs of your requests where you can make the API calls.\n\n#### Example\n\n##### Guzzle\n```php\nfunction makeFacebookApiCall(array $body, Client $facebook_client)\n{\n    $request_headers = [\n        'api-key' =\u003e $config-\u003eapiKey,\n        'Content-Type' =\u003e 'application/json',\n    ];\n\n    $versioned_path = self::buildVersionedUrlPath($path);\n\n    $encoded_body = json_encode($body, JSON_UNESCAPED_SLASHES);\n\n    $request = new Request(\n        'GET',\n        '/v1/users',\n        $request_headers,\n        $encoded_body,\n    );\n    \n    $request_log = FacebookRequestLog::makeFromGuzzle($request);\n    \n    $response = $client-\u003esend($request);\n    \n    $request_log-\u003eresponse_code = $response-\u003egetStatusCode();\n    $request_log-\u003eresponse = json_decode((string)$response-\u003egetBody(), true);\n    $request_log-\u003esave();\n}\n```\nYou can also manually set each property and then save the log instance.\n\n### Testing\n\n``` bash\ncomposer test\n```\n\n### Using Docker\nAll assets are set up under the docker-compose.yml file. The first time you run the docker image you must build it with\nthe following command:\n```bash\n./docker.sh -b -s\n```\n\nThen you can bring it up in the background using:\n```bash\n./docker.sh -d\n```\n\nFrom there you can run the tests within an isolated environment\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n### Security\n\nIf you discover any security related issues, please email @qschmick instead of using the issue tracker.\n\n## Credits\n\n- [Quentin Schmick](https://github.com/qschmick)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falways-open%2Flaravel-request-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falways-open%2Flaravel-request-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falways-open%2Flaravel-request-logger/lists"}