make:data
Generate new data objects quickly.Basic Usage
App\Data\PostData in the app/Data directory.
Custom Namespace
Change the namespace:App\DataTransferObjects\PostData in app/DataTransferObjects.
Options
Examples
Configuration
Customize default behavior inconfig/data.php:
Custom Stub
Publish and customize the stub file:stubs/data.stub:
data:cache-structures
Cache data object analysis for production performance.Basic Usage
Show Cached Classes
Display which classes were cached:When to Run
Run this command:- Before deploying to production
- After creating new data objects
- After modifying existing data objects
- As part of your deployment script
Deployment Script Example
Error Handling
If caching is disabled in config:config/data.php:
Clear Cache
Clear the data structures cache:The cache key prefix is configurable in
config/data.php under structure_caching.cache.prefix.