### Introduction: #### What is API Resources in Laravel > __LARAVEL's__ resource classes allow you to expressively and easily transform your models and model collections into JSON.Basically you can generate a nice json formatted data right from Eloquent. Laravel's resource classes allow you to expressively and easily transform your models and model collections into JSON. Let’s learn how to generate api resources.Consider you have a user table in your database and you want to generate api resources for your User model.Run following command on your terminal window while being on laravel project root directory: #### STEP 1: Generating Resources + Run this Command to generate a resource class. + By default, resources will be placed in the `app/Http/Resources` directory of your application. Resources extend the `Illuminate\Http\Resources\Json\JsonResource` class: **`php artisan make:resource User`** resources #### STEP 2: Concept Overview Before diving into all of the options available to you when writing resources, let's first take a high-level look at how resources are used within Laravel. A resource class represents a single model that needs to be transformed into a JSON structure. For example, here is a simple User resource class: +Change the content of above file as shown below. ```php ## My basic recommendation for learning : [Eloquent: API Resources](https://laravel.com/docs/7.x/eloquent-resources) ## Thanks ##