Overview of laravel-data capabilities
mainBy extending the Data class, you gain several automated features for handling data within Laravel applications:
- Transformation: Automatically transform data objects into resources (similar to Laravel API resources).
- Lazy Loading: Transform only requested parts of data objects using lazy properties.
- Request Handling: Automatically create and validate data objects from incoming request data.
- Validation: Automatically resolve validation rules based on PHP type hints and property definitions.
- Type Safety: Ensure data is typed when moving between the frontend and backend.
- Frontend Integration: Automatically generate TypeScript definitions from your PHP data objects.
- Eloquent Integration: Save data objects as properties of an Eloquent model.