The Laravel API Toolkit is a comprehensive package designed to simplify the development of RESTful APIs in Laravel. It provides tools to enhance API functionality, improve error handling, and ensure consistent data output, making API development faster and more reliable.
- Exception Handling: Implements a custom exception handler that captures and formats all exceptions for consistent API error responses.
- Queryable Models: Allows fine-tuned control over which fields are exposed via your API endpoints, enhancing security and customization.
- Data Repositories: Abstracts database interactions into repositories to promote a cleaner and more maintainable codebase.
- Data Resources: Ensures consistent presentation of data across different API endpoints, simplifying client-side data integration.
To install the Laravel API Toolkit, run the following command in your project directory:
composer require sinemacula/laravel-api-toolkit
After installation, publish the package configuration to customize it according to your needs:
php artisan vendor:publish --provider="SineMacula\ApiServiceProvider"
This command publishes the package configuration file to your application's config directory, allowing you to modify aspects such as exception handling behaviors, data repository settings, and more.
Detailed usage instructions will be provided soon. This section will cover how to integrate the toolkit into your Laravel application, including setting up queryable models, using data repositories, and applying data transformers.
Contributions are welcome and will be fully credited. We accept contributions via pull requests on GitHub.
If you discover any security related issues, please email instead of using the issue tracker.
The Laravel API Toolkit repository is open-sourced software licensed under the Apache License, Version 2.0.