When building an API, you may need a transformation layer that sits between your Eloquent models and the JSON responses that are actually returned to your application's users. Laravel's resource classes allow you to expressively and easily transform your models and model collections into JSON.
Click here, https://bit.ly/2y4WUpj
Laravel Resources:
https://laravel.com/docs/7.x/eloquent...