{"id":23882291,"url":"https://github.com/jenky/laravel-api","last_synced_at":"2026-05-06T18:33:32.586Z","repository":{"id":56997952,"uuid":"74665783","full_name":"jenky/laravel-api","owner":"jenky","description":null,"archived":false,"fork":false,"pushed_at":"2021-02-20T17:48:31.000Z","size":175,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-28T16:36:39.786Z","etag":null,"topics":["api","laravel","rest","rest-api"],"latest_commit_sha":null,"homepage":null,"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/jenky.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-11-24T11:10:47.000Z","updated_at":"2021-02-20T17:48:33.000Z","dependencies_parsed_at":"2022-08-21T14:50:23.375Z","dependency_job_id":null,"html_url":"https://github.com/jenky/laravel-api","commit_stats":null,"previous_names":[],"tags_count":40,"template":false,"template_full_name":null,"purl":"pkg:github/jenky/laravel-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenky%2Flaravel-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenky%2Flaravel-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenky%2Flaravel-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenky%2Flaravel-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jenky","download_url":"https://codeload.github.com/jenky/laravel-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenky%2Flaravel-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271998854,"owners_count":24856123,"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-08-25T02:00:12.092Z","response_time":1107,"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":["api","laravel","rest","rest-api"],"created_at":"2025-01-04T02:53:12.037Z","updated_at":"2026-05-06T18:33:32.559Z","avatar_url":"https://github.com/jenky.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel API\n\n[![Latest Version on Packagist][ico-version]][link-packagist]\n[![Test Status][ico-gh-tests]][link-gh-tests]\n[![Codecov][ico-codecov]][link-codecov]\n[![Total Downloads][ico-downloads]][link-downloads]\n[![Software License][ico-license]](LICENSE.md)\n\nThe package provides a nice and easy way to define API routes and format JSON error response.\n\n- [Laravel API](#laravel-api)\n  - [Install](#install)\n  - [Installation](#installation)\n  - [Configuration](#configuration)\n  - [Usage](#usage)\n    - [Error response](#error-response)\n  - [Change log](#change-log)\n  - [Testing](#testing)\n  - [Contributing](#contributing)\n  - [Security](#security)\n  - [Credits](#credits)\n  - [License](#license)\n\n## Install\n\n## Installation\n\nYou may use Composer to install this package into your Laravel project:\n\n``` bash\n$ composer require jenky/laravel-api\n```\n\nAfter installing, publish its assets using the `vendor:publish` Artisan command.\n\n``` bash\nphp artisan vendor:publish\n```\n\nor\n\n``` bash\nphp artisan vendor:publish --provider=\"Jenky\\LaravelAPI\\ApiServiceProvider\"\n```\n\n## Configuration\n\nAfter publishing Laravel API's assets, its primary configuration file will be located at `config/api.php`. This configuration file allows you to configure your api route and error response format and each configuration option includes a description of its purpose, so be sure to thoroughly explore this file.\n\n\u003e For Header versioning, if the request doesn't have the `Accept` header with correct format then default version from config will be used.\n\n## Usage\n\n### Error response\n\nDealing with errors when building an API can be a pain. Instead of manually building error responses you can simply throw an exception and the API will handle the response for you. Just add the trait `ExceptionResponse` to your `app/Exceptions/Handler` and the package will automatically catches the thrown exception and will convert it into its JSON representation.\n\n``` php\n\u003c?php\n\nnamespace App\\Exceptions;\n\nuse Illuminate\\Foundation\\Exceptions\\Handler as ExceptionHandler;\nuse Jenky\\LaravelAPI\\Exception\\ExceptionResponse;\n\nclass Handler extends ExceptionHandler\n{\n    use ExceptionResponse;\n}\n```\n\n\u003e You can change the default error response format in `config/api.php` file.\n\n## Change log\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Testing\n\n``` bash\n$ composer test\n```\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) and [CODE_OF_CONDUCT](CODE_OF_CONDUCT.md) for details.\n\n## Security\n\nIf you discover any security related issues, please email contact@lynh.me instead of using the issue tracker.\n\n## Credits\n\n- [Lynh][link-author]\n- [All Contributors][link-contributors]\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n\n[ico-version]: https://img.shields.io/packagist/v/jenky/laravel-api.svg\n[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg\n[ico-travis]: https://img.shields.io/travis/com/jenky/laravel-api/master.svg\n[ico-scrutinizer]: https://img.shields.io/scrutinizer/coverage/g/jenky/laravel-api.svg\n[ico-code-quality]: https://img.shields.io/scrutinizer/g/jenky/laravel-api.svg\n[ico-downloads]: https://img.shields.io/packagist/dt/jenky/laravel-api.svg\n[ico-gh-tests]: https://github.com/jenky/laravel-api/workflows/Tests/badge.svg\n[ico-codecov]: https://codecov.io/gh/jenky/laravel-api/branch/master/graph/badge.svg\n\n[link-packagist]: https://packagist.org/packages/jenky/laravel-api\n[link-travis]: https://travis-ci.com/jenky/laravel-api\n[link-scrutinizer]: https://scrutinizer-ci.com/g/jenky/laravel-api/code-structure\n[link-code-quality]: https://scrutinizer-ci.com/g/jenky/laravel-api\n[link-downloads]: https://packagist.org/packages/jenky/laravel-api\n[link-author]: https://github.com/jenky\n[link-contributors]: ../../contributors\n[link-gh-tests]: https://github.com/jenky/laravel-api/actions\n[link-codecov]: https://codecov.io/gh/jenky/laravel-api\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjenky%2Flaravel-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjenky%2Flaravel-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjenky%2Flaravel-api/lists"}