Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jpcaparas/demo-laravel-api-platform

A demo Laravel project to showcase the capabilities of api-platform/laravel
https://github.com/jpcaparas/demo-laravel-api-platform

Last synced: about 10 hours ago
JSON representation

A demo Laravel project to showcase the capabilities of api-platform/laravel

Awesome Lists containing this project

README

        

Laravel Logo

API Platform example

# API Platform for Laravel Demo (Game Collection)

This is a demo Laravel application showcasing how to build a RESTful API for managing video game collections using [API Platform](https://api-platform.com/docs/laravel/) and Laravel.

## Features

- [x] RESTful API endpoints for managing video games
- [x] Integration with API Platform for standardized API responses
- [x] Game entity with properties like title, description, collection, reviews, and release date
- [x] Full CRUD operations
- [x] API documentation via OpenAPI/Swagger
- [ ] Authentication and authorization
- [ ] Pagination and filtering

## Requirements

- PHP 8.2 or higher
- Composer
- Laravel 11.x
- Database (MySQL by default)

## Setup

### Clone the repository
```bash
git clone https://github.com/jpcaparas/demo-laravel-api-platform.git
```

### Install dependencies
```
composer install
```

### Configure environment
```bash
cp .env.example .env
php artisan key:generate
```

### Run migrations
```bash
php artisan migrate
```

### Seed demo data
```bash
php artisan db:seed
```

## Testing it out

Once everything is set up, you can start the development server and test the API endpoints.

```bash
php artisan serve
```

You can now access the API at `http://localhost:8000/api`.

## Resources

- [API Platform for Laravel](https://api-platform.com/docs/laravel/)
- [Customising the API](https://api-platform.com/docs/laravel/#customizing-the-api)
- [Adding filters](https://api-platform.com/docs/laravel/#adding-filters)
- [Adding authentication](https://api-platform.com/docs/laravel/#authentication)
- [Parameters & filters](https://api-platform.com/docs/laravel/filters/)