API Resources are transformation classes that control how Eloquent models (and collections) are serialized to JSON for API responses. They let you shape the API output precisely — choosing which fields to expose, renaming them, formatting values, and including related data — decoupling the API representation from the database structure.
The problem: exposing raw models
::();
