|Last Updated|| ||Ratings|| ||Unique User Downloads|| ||Download Rankings|
|2023-09-07 (22 days ago) ||Not yet rated by the users||Total: 45 This week: 1||All time: 10,617 This week: 109|
This package provides a framework that extracts route details from classes.
It implements the Command Query Responsibility Segregation pattern (CQRS) by parsing the routing information to route HTTP requests that match route pattern parameters defined in comments of the application route classes.
This framework uses PHP reflection to parse the application route classes comments and extract route details like the route:
- HTTP request type
- Name of the controller class and function name that will handle the routed request
- Required request headers
The framework can also validate the request parameters according to rules that applications define in map request classes.
|PHP 8 implements the possibility to extract attributes defined in comments of PHP classes using PHP reflection support.
This package uses this possibility to implement an MVC framework that developers can use to configure HTTP request routes using route classes that comment attributes that define the details of the routing of HTTP requests to controller classes.
This way, developers can define the PHP application HTTP request routing configuration in the same class file that implements the routing code.
This possibility makes it easier to maintain complex PHP applications because it avoids the need to define routing PHP code in a separate file from the routing configuration.
PotatoService: API-Centric Framework
PotatoService is a comprehensive PHP framework meticulously crafted for API development. Infused with a plethora of features and streamlined methodologies, it stands out as a quintessential tool for creating scalable, reliable, and efficient APIs. Here's a dive into its core functionalities and design philosophies:
Resource Management: At the heart of any RESTful API lies the principle of resource orientation. PotatoService offers a structured approach to map requests to specific resources, ensuring a clear and logical organization of endpoints.
Dynamic Routing: Through the `#[Route]` annotation, the framework brings forth a flexible routing mechanism. This system is intricately designed to cater to various HTTP methods, establishing a foundation for a versatile API handling.
Seamless Input Validation: APIs often act as gatekeepers, ensuring that only valid data interacts with the system. PotatoService's integrated validation attributes empower developers to define and rigorously check request inputs. This built-in robustness guarantees data integrity and security.
Exception Handling with Clarity: In the realm of APIs, precise and informative feedback is paramount. PotatoService distinguishes between `BusinessException` and `ServerException`, delivering structured JSON responses. This nuanced approach ensures that clients receive clear and actionable error messages.
Attribute-Driven Design: One of PotatoService's standout features is its rich attribute system. Attributes like `#[Cache]`, `#[Transactional]`, and various validations play pivotal roles in enhancing performance, ensuring data consistency, and maintaining data integrity.
Interactive Console: A testament to its comprehensive nature, PotatoService boasts an interactive console. This tool is instrumental for backend operations, be it migrations, cache operations, or other housekeeping tasks, making API maintenance a breeze.
PHP Version Requirement: 8.1 or higher
The framework's architecture is divided into three distinct layers:
Project Settings: Modify the .env file to adjust your project settings. Path: infrastructure/.env -> $_ENV
Dependencies: Set up and configure dependencies using composer. Path: infrastructure/composer.json
||Applications that use this package
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.