PHPackages                             anomaly/streams-api - 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. anomaly/streams-api

ActiveStreams-addon

anomaly/streams-api
===================

A RESTful API for Laravel Streams.

1.0.x-dev(4mo ago)1582MITPHP

Since Jan 13Pushed 4mo ago3 watchersCompare

[ Source](https://github.com/laravel-streams/streams-api)[ Packagist](https://packagist.org/packages/anomaly/streams-api)[ RSS](/packages/anomaly-streams-api/feed)WikiDiscussions 1.0 Synced 4d ago

READMEChangelogDependencies (5)Versions (1)Used By (0)

Streams API
===========

[](#streams-api)

A powerful, flexible RESTful API package for the Laravel Streams platform. Get instant CRUD endpoints for all your streams with extensive customization options.

Features
--------

[](#features)

- 🚀 **Automatic REST Endpoints** - Instant CRUD operations for all streams
- 🔍 **Advanced Querying** - Filtering, pagination, and custom query methods
- 🎯 **Custom Interfaces** - Multiple API configurations with different prefixes and middleware
- 🛠️ **Custom Endpoints** - Easy to add your own routes and logic
- 🔐 **Middleware Support** - Authentication, rate limiting, and more
- 📚 **OpenAPI/Swagger** - Auto-generate interactive API documentation
- ⚡ **Response Formatting** - Standardized JSON responses
- 💾 **HTTP Caching** - Built-in caching with ETag support

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

[](#installation)

```
composer require streams/api:1.0.x-dev
```

Quick Start
-----------

[](#quick-start)

Enable the API in your `.env`:

```
STREAMS_API_ENABLED=true
```

Register routes in your `AppServiceProvider`:

```
use Streams\Api\Support\Facades\API;

public function boot()
{
    API::routeEntries();  // Entry CRUD endpoints
    API::routeStreams();   // Stream management endpoints
}
```

That's it! Your API is now available at `/api`.

Documentation
-------------

[](#documentation)

**📖 [Full Documentation](https://streams.dev/docs/api/introduction)**

- [Introduction](https://streams.dev/docs/api/introduction) - Overview and quick start
- [Configuration](https://streams.dev/docs/api/configuration) - Configure the API
- [Query Parameters](https://streams.dev/docs/api/query-parameters) - Filter and paginate data
- [Custom Interfaces](https://streams.dev/docs/api/custom-interfaces) - Multiple API configurations
- [Custom Endpoints](https://streams.dev/docs/api/custom-endpoints) - Add your own routes
- [Responses](https://streams.dev/docs/api/responses) - Format API responses
- [OpenAPI](https://streams.dev/docs/api/openapi) - Generate Swagger documentation
- [Testing](https://streams.dev/docs/api/testing) - Test your API

**Note**: Documentation URLs like `/docs/api/introduction` correspond to `docs/introduction.md` in this repository.

Default Endpoints
-----------------

[](#default-endpoints)

### Stream Management

[](#stream-management)

```
GET    /api/streams              # List all streams
POST   /api/streams              # Create a stream
GET    /api/streams/{stream}     # Get a stream
PUT    /api/streams/{stream}     # Update a stream
PATCH  /api/streams/{stream}     # Partially update a stream
DELETE /api/streams/{stream}     # Delete a stream

```

### Entry Management

[](#entry-management)

```
GET    /api/streams/{stream}/entries           # List entries
POST   /api/streams/{stream}/entries           # Create an entry
GET    /api/streams/{stream}/entries/{entry}   # Get an entry
PUT    /api/streams/{stream}/entries/{entry}   # Update an entry
PATCH  /api/streams/{stream}/entries/{entry}   # Partially update an entry
DELETE /api/streams/{stream}/entries/{entry}   # Delete an entry

```

### Query Endpoint

[](#query-endpoint)

```
POST   /api/streams/{stream}/query   # Advanced queries

```

Usage Examples
--------------

[](#usage-examples)

### Filtering &amp; Pagination

[](#filtering--pagination)

```
GET /api/streams/posts/entries?where[status]=published&per_page=10&page=1
```

### Advanced Queries

[](#advanced-queries)

```
POST /api/streams/posts/query
Content-Type: application/json

{
    "parameters": [
        {"where": ["status", "published"]},
        {"where": ["views", ">", 100]},
        {"orderBy": ["created_at", "desc"]},
        {"limit": [20]}
    ]
}
```

### Custom Interface

[](#custom-interface)

```
use Streams\Api\ApiInterface;
use Streams\Api\Support\Facades\API;

$api = new ApiInterface('v1');
$api->path('api/v1');
$api->middleware(['auth:sanctum', 'throttle:60,1']);

API::interface($api);
API::routeEntries();
```

### Custom Endpoint

[](#custom-endpoint)

```
use Streams\Api\ApiResponse;

$api->endpoints([
    'featured' => function () {
        $posts = Streams::entries('posts')
            ->where('featured', true)
            ->get();

        return ApiResponse::make($posts);
    }
]);
```

Configuration
-------------

[](#configuration)

Publish configuration file:

```
php artisan vendor:publish --provider=Streams\\Api\\ApiServiceProvider --tag=config
```

```
// config/streams/api.php
return [
    'enabled' => env('STREAMS_API_ENABLED', false),
    'prefix' => env('STREAMS_API_PREFIX', 'api'),
    'middleware' => env('STREAMS_API_MIDDLEWARE', 'api'),
];
```

Generate Documentation
----------------------

[](#generate-documentation)

Create OpenAPI schema:

```
php artisan api:schema
```

Generate Swagger UI:

```
php artisan api:documentation
```

Visit `/docs/api/index.html` to view interactive API documentation.

Testing
-------

[](#testing)

Run tests:

```
php vendor/bin/phpunit
```

Generate coverage report:

```
XDEBUG_MODE=coverage php vendor/bin/phpunit --coverage-html=./coverage
```

Current test suite: **142 tests**, **394 assertions** ✅

Security
--------

[](#security)

⚠️ **Important**: The API is disabled by default and all endpoints are public. Enable authentication:

```
// config/streams/api.php
'middleware' => ['api', 'auth:sanctum', 'throttle:60,1'],
```

Or per-interface:

```
$api->middleware(['auth:sanctum']);
```

Requirements
------------

[](#requirements)

- PHP 8.1+
- Laravel 10.0+
- Streams Core 1.0+

License
-------

[](#license)

The Streams API is open-source software licensed under the [MIT license](LICENSE.md).

Support
-------

[](#support)

- 📖 [Documentation](https://streams.dev/docs/api/introduction)
- 💬 [Discussions](https://github.com/laravel-streams/streams-api/discussions)
- 🐛 [Issues](https://github.com/laravel-streams/streams-api/issues)
- 🌐 [Website](https://streams.dev)

Roadmap
-------

[](#roadmap)

- Gates based on Core/Laravel Gates for authorization
- API versioning helpers
- Rate limiting per endpoint
- API key authentication
- Webhook support
- GraphQL support
- Real-time subscriptions
- Batch operations
- API analytics/metrics

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance78

Regular maintenance activity

Popularity11

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity18

Early-stage or recently created project

 Bus Factor1

Top contributor holds 81.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

122d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3dc718dba9317e897b74dcb30e5c06bd106e1ad72b2df5242b66bcc28053fbf3?d=identicon)[anomaly](/maintainers/anomaly)

---

Top Contributors

[![RyanThompson](https://avatars.githubusercontent.com/u/1099967?v=4)](https://github.com/RyanThompson "RyanThompson (140 commits)")[![RobinRadic](https://avatars.githubusercontent.com/u/754732?v=4)](https://github.com/RobinRadic "RobinRadic (27 commits)")[![BubeCPH](https://avatars.githubusercontent.com/u/63174222?v=4)](https://github.com/BubeCPH "BubeCPH (3 commits)")[![mustafa-online](https://avatars.githubusercontent.com/u/5323832?v=4)](https://github.com/mustafa-online "mustafa-online (1 commits)")

###  Code Quality

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/anomaly-streams-api/health.svg)

```
[![Health](https://phpackages.com/badges/anomaly-streams-api/health.svg)](https://phpackages.com/packages/anomaly-streams-api)
```

###  Alternatives

[infection/infection

Infection is a Mutation Testing framework for PHP. The mutation adequacy score can be used to measure the effectiveness of a test set in terms of its ability to detect faults.

2.2k26.2M1.8k](/packages/infection-infection)[ergebnis/composer-normalize

Provides a composer plugin for normalizing composer.json.

1.1k37.3M2.1k](/packages/ergebnis-composer-normalize)[humbug/box

Fast, zero config application bundler with PHARs.

1.3k801.5k69](/packages/humbug-box)[pantheon-systems/terminus

A command line interface for Pantheon

3391.5M13](/packages/pantheon-systems-terminus)[php-opencloud/openstack

PHP SDK for OpenStack APIs. Supports BlockStorage, Compute, Identity, Images, Networking and Metric Gnocchi

2292.2M24](/packages/php-opencloud-openstack)[getdkan/dkan

DKAN Open Data Catalog

385135.4k2](/packages/getdkan-dkan)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
