# API Platform for Laravel

By Dinesh Uprety
Published: 2024-09-25
Updated: 2024-09-25
Canonical: https://laranepal.com/blog/api-platform-for-laravel

# API Platform

[API Platform](https://api-platform.com/) is a powerful yet easy-to-use **full stack** framework dedicated to API-driven projects and implementing the [Jamstack](https://jamstack.org/) architecture.

## Why Use API Platform for Laravel Projects?
API Platform is the **easiest way** to create **state-of-the-art** web APIs using Laravel!
### Key Features of API Platform:
* Automatically expose nice UIs and playgrounds to develop using your API (**Swagger UI** **and GraphiQ**L)
* Automatically paginate your collections
* Add validation logic using [**Laravel Form Request Validation**](https://api-platform.com/docs/symfony/#write-operations-authorization-and-validation)
* And much more...

Let’s dive into how to use API Platform with Laravel.

## Step 1: Installing Laravel
API Platform can be installed easily on new and existing Laravel projects. If you already have an existing project, skip directly to the next section.

If you don’t have an existing Laravel project, [create one](https://laravel.com/docs/11.x/installation). All Laravel installation methods are supported. For instance, you can use Composer:
```shell
composer create-project laravel/laravel my-api-platform-laravel-app
cd my-api-platform-laravel-app
```
## Step 2: Installing API Platform
To install API Platform, run the following:
```shell
composer require api-platform/laravel
```
## Step 3: Publishing Config and Assets
Once API Platform is installed, you can use the Artisan command to publish its config and assets:🏀
```shell
php artisan api-platform:install
```
To start the development server, run:
```shell
php artisan serve
```
You can now visit `http://127.0.0.1:8000/api/` to see your API in action! While it's still empty, the documentation will be automatically generated.
![Demo Api Platform](https://api-platform.com/docs/laravel/images/empty-docs.png)
## Conclusion
**API Platform** simplifies API development in Laravel by automatically generating UI, handling pagination, and enabling request validation, among other things. With just a few commands, you can get your API up and running with all the modern tools developers love.
