{"id":26635958,"url":"https://github.com/zakigit1/api_expert","last_synced_at":"2026-04-13T20:02:14.807Z","repository":{"id":281420268,"uuid":"945225446","full_name":"zakigit1/API_Expert","owner":"zakigit1","description":"API_Expert - A comprehensive learning resource for mastering advanced topics in RESTful APIs, including filtering, pagination, and authentication. Perfect for developers seeking to deepen their understanding and expertise.","archived":false,"fork":false,"pushed_at":"2025-03-19T00:19:32.000Z","size":94,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-19T01:26:18.806Z","etag":null,"topics":["filtering","json","laravel","resources","restful-api","sanctum-authentication","sqlite","token-abilities"],"latest_commit_sha":null,"homepage":"","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/zakigit1.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}},"created_at":"2025-03-08T23:57:15.000Z","updated_at":"2025-03-19T00:19:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"b6424a43-475f-4c93-b840-84bde643f3e3","html_url":"https://github.com/zakigit1/API_Expert","commit_stats":null,"previous_names":["zakigit1/api_expert"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zakigit1%2FAPI_Expert","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zakigit1%2FAPI_Expert/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zakigit1%2FAPI_Expert/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zakigit1%2FAPI_Expert/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zakigit1","download_url":"https://codeload.github.com/zakigit1/API_Expert/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245304871,"owners_count":20593626,"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":["filtering","json","laravel","resources","restful-api","sanctum-authentication","sqlite","token-abilities"],"created_at":"2025-03-24T16:15:45.633Z","updated_at":"2026-04-13T20:02:14.777Z","avatar_url":"https://github.com/zakigit1.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel API Advance\n\nA comprehensive Laravel API project demonstrating advanced API development techniques including filtering, pagination, resource handling, and relationship loading. This project serves as a learning resource for building robust and scalable APIs with Laravel.\n\n## Project Overview\n\nThis project implements a RESTful API for managing customers and invoices, showcasing best practices for API development in Laravel. It's designed to demonstrate how to structure APIs with versioning (V1), implement advanced filtering, handle pagination, and efficiently manage resources and relationships.\n\n## Key Features\n\n### API Versioning\n- Organized API endpoints under versioned namespaces (V1)\n- Structured controllers, resources, and filters by version\n\n### Advanced Filtering\n- Custom filter implementation for query parameters\n- Support for various operators (eq, neq, gt, gte, lt, lte)\n- Column mapping for translating API fields to database columns\n\n### Pagination\n- Built-in pagination for all collection endpoints\n- Preserving query parameters across paginated results\n\n### Resource Handling\n- Transformation of database models to API resources\n- Consistent JSON response structure\n- Camel case field naming convention for API responses\n\n### Relationship Loading\n- Conditional relationship loading with `whenLoaded`\n- Query parameter control for including relationships\n- Efficient loading of related resources\n\n### Authentication\n- Sanctum-based API authentication\n- Protected routes with middleware\n\n### Bulk Operations\n- Support for bulk creation of resources\n\n## Installation\n\n1. Clone the repository\n   ```bash\n   git clone \u003crepository-url\u003e\n   cd Laravel_API_Advance\n   ```\n\n2. Install dependencies\n   ```bash\n   composer install\n   ```\n\n3. Create and configure environment file\n   ```bash\n   cp .env.example .env\n   php artisan key:generate\n   ```\n\n4. Configure your database in the `.env` file\n   ```\n   DB_CONNECTION=mysql\n   DB_HOST=127.0.0.1\n   DB_PORT=3306\n   DB_DATABASE=your_database\n   DB_USERNAME=your_username\n   DB_PASSWORD=your_password\n   ```\n\n5. Run migrations and seeders\n   ```bash\n   php artisan migrate\n   php artisan db:seed\n   ```\n\n6. Start the development server\n   ```bash\n   php artisan serve\n   ```\n\n## API Usage\n\n### Authentication\n\n```bash\n# Login to get access token\nPOST /api/v1/login\n```\n\n### Customers\n\n```bash\n# Get all customers (with pagination)\nGET /api/v1/customers\n\n# Get all customers with their invoices\nGET /api/v1/customers?includeInvoices=true\n\n# Filter customers\nGET /api/v1/customers?name[eq]=John\nGET /api/v1/customers?postalCode[gt]=10000\n\n# Get a specific customer\nGET /api/v1/customers/{id}\n\n# Create a customer\nPOST /api/v1/customers\n\n# Update a customer\nPUT /api/v1/customers/{id}\n\n# Delete a customer\nDELETE /api/v1/customers/{id}\n```\n\n### Invoices\n\n```bash\n# Get all invoices (with pagination)\nGET /api/v1/invoices\n\n# Filter invoices\nGET /api/v1/invoices?amount[gt]=100\nGET /api/v1/invoices?status[eq]=paid\n\n# Get a specific invoice\nGET /api/v1/invoices/{id}\n\n# Create an invoice\nPOST /api/v1/invoices\n\n# Create multiple invoices\nPOST /api/v1/invoices/bulk\n\n# Update an invoice\nPUT /api/v1/invoices/{id}\n\n# Delete an invoice\nDELETE /api/v1/invoices/{id}\n```\n\n## Filter Operators\n\nThe API supports the following filter operators:\n\n- `eq`: Equal to\n- `neq`: Not equal to\n- `gt`: Greater than\n- `gte`: Greater than or equal to\n- `lt`: Less than\n- `lte`: Less than or equal to\n\nExample: `/api/v1/customers?postalCode[gte]=10000\u0026postalCode[lte]=20000`\n\n## API Documentation\n\nDetailed API documentation is available in the [API_DOCUMENTATION.md](API_DOCUMENTATION.md) file. This documentation includes:\n\n- Complete list of all API endpoints\n- Request and response formats with examples\n- Authentication instructions\n- Query parameter options for filtering and pagination\n- Instructions for including related resources\n\n## License\n\nThis project is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzakigit1%2Fapi_expert","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzakigit1%2Fapi_expert","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzakigit1%2Fapi_expert/lists"}