php artisan make:resource
Code GenerationCreate a new API resource
Options & Flags
Available options for this command
--collectionCreate a resource collection
Examples
Common usage examples
Create an API resource
php artisan make:resource UserResourceCreate a resource collection
php artisan make:resource UserCollection --collectionNotes
- Transform models into JSON responses
- Use in API endpoints
Related Commands
You might also find these useful