PHPackages                             volcanic/volcanic - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. volcanic/volcanic

ActiveLibrary[API Development](/categories/api)

volcanic/volcanic
=================

The ultimate solution for Laravel APIs

031[4 PRs](https://github.com/volcanicphp/volcanic/pulls)PHPCI passing

Since Oct 13Pushed 1mo agoCompare

[ Source](https://github.com/volcanicphp/volcanic)[ Packagist](https://packagist.org/packages/volcanic/volcanic)[ RSS](/packages/volcanic-volcanic/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (5)Used By (0)

The ultimate so- ✅ **Automatic CRUD API generation** with PHP attributes
========================================================================

[](#the-ultimate-so---automatic-crud-api-generation-with-php-attributes)

- ✅ **Advanced query capabilities** (sorting, filtering, searching)
- ✅ **Built-in pagination** with customizable settings
- ✅ **Flexible validation** with per-operation rules
- ✅ **Middleware support** for authentication and authorization
- ✅ **Smart soft delete handling** with automatic trait detection
- ✅ **Route customization** (prefix, names, operations)
- ✅ **Auto-discovery** with manual override optionsution for Laravel APIs

[![Latest Version on Packagist](https://camo.githubusercontent.com/31213092a08a86cef8b57ecfacc4f7abe961834777bf5511768b4027e0a05c19/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f766f6c63616e69632f766f6c63616e69632e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/volcanic/volcanic)[![GitHub Tests Action Status](https://camo.githubusercontent.com/a5ac45529abb7d6a27cd80fe008dc9a4ef01501e8727dd1c94b27beb4e6f12e7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f766f6c63616e69632f766f6c63616e69632f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/volcanic/volcanic/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/671b5b43e5ee80d17ec977745b66009c1f52b008923e9abba261823ef1d348ae/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f766f6c63616e69632f766f6c63616e69632f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/volcanic/volcanic/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/467349d1c31b6e2251cb7f5e68468dd3c114fc497377c894d0666166e1118d6a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f766f6c63616e69632f766f6c63616e69632e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/volcanic/volcanic)

Volcanic is a Laravel package that provides a powerful, attribute-based approach to creating RESTful APIs. Simply add the `#[ApiResource]` attribute to your Eloquent models and get full CRUD operations automatically, with advanced features like filtering, sorting, searching, pagination, and validation.

Features
--------

[](#features)

- ✅ **Automatic CRUD API generation** with PHP attributes
- ✅ **Advanced query capabilities** (sorting, filtering, searching)
- ✅ **Built-in pagination** with customizable settings
- ✅ **Flexible validation** with per-operation rules
- ✅ **Middleware support** for authentication and authorization
- ✅ **Soft delete handling** with restore and force delete operations
- ✅ **Route customization** (prefix, names, operations)
- ✅ **Auto-discovery** with manual override options
- 🆕 **Interactive API Playground** - GraphiQL-like interface for REST APIs
- 🆕 **Schema Introspection** - Auto-generated API documentation from your models

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require volcanic/volcanic
```

You can publish the config file with:

```
php artisan vendor:publish --tag="volcanic-config"
```

This is the contents of the published config file:

```
return [
];
```

Optionally, you can publish the views using

```
php artisan vendor:publish --tag="volcanic-views"
```

Usage
-----

[](#usage)

### Basic Usage

[](#basic-usage)

Add the `#[ApiResource]` attribute to any Eloquent model to automatically expose CRUD operations:

```
