Source adapters helps you query any source of data you might encounter in the wild.
Specify source information in your stream configuration.
If no source is specified, the below defaults will be assumed.
// streams/{handle}.json
{
"config": {
"source": {
"format": "json",
"type": "filebase",
"path": "streams/data/{handle}"
}
}
}
The following sources are available with the Streams platform by default.
You can define data within on your stream configuration file.
// streams/contacts.json
{
"config": {
"source": {
"type": "self"
}
},
"data": {
"john": {
"name": "John Doe"
},
"jane": {
"name": "Jane Doe"
}
}
}
The flat file database powered by the fantastic Filebase package is the default source.
// streams/contacts.json
{
"config": {
"source": {
"format": "json",
"type": "filebase",
"path": "streams/data/contacts"
}
}
}
// streams/data/contacts/ryan.json
{
"name": "Ryan",
"email": "[email protected]"
}
@verbatim
// streams/data/contacts/ryan.yaml
---
name: "Ryan"
email: "[email protected]"
---
The body is built in: {{ $entry->name }}
@endverbatim
@verbatim
// streams/data/contacts/ryan.md
---
name: "Ryan"
email: "[email protected]"
---
The body is built in: {{ $entry->name }}
@endverbatim
@verbatim
// streams/data/contacts/ryan.tpl
---
name: "Ryan"
email: "[email protected]"
---
The body is built in: {{ $entry->name }}
@endverbatim
The eloquent model source uses Laravel models to query and can return stream-enhanced Eloquent models.
// streams/contacts.json
{
"config": {
"source": {
"type": "eloquent",
"model": "App\\Contact\\ContactModel"
}
}
}
The Laravel database source uses generic Laravel database tables to query and return stream entries.
// streams/contacts.json
{
"config": {
"source": {
"type": "database",
"table": "contacts",
"connection": "default"
}
}
}
You can create and register a custom source adapter for any source of information you might encounter.
@todo Talk about developing custom source adapters.
A blank TALL-stack Laravel project with Streams.
The fundamental features and utilities offered by the Streams platform.
A universal and extensible RESTful API for Streams.
Extensible, user-friendly, and performant control panel, components, and services.
Dev tooling for Laravel Streams.