Skip to content

Instantly share code, notes, and snippets.

@mattcdavis1
Created November 10, 2014 21:54
Show Gist options
  • Save mattcdavis1/7e53ae55f3c7db6122ed to your computer and use it in GitHub Desktop.
Save mattcdavis1/7e53ae55f3c7db6122ed to your computer and use it in GitHub Desktop.
Resource Stream
<?php namespace Anomaly\Streams\Addon\Module\Resources\Installer;
use Anomaly\Streams\Platform\Field\FieldInstaller;
/**
* Class UsersFieldInstaller
*/
class ResourcesFieldInstaller extends FieldInstaller
{
/**
* Fields to install.
*
* @var array
*/
protected $fields = [
'title' => [
'type' => 'text',
],
'name' => [
'type' => 'text',
],
'slug' => [
'type' => 'slug',
'settings' => [
'separator' => '-',
]
],
'content' => [
'type' => 'repeating',
],
'description' => [
'type' => 'text',
],
'category' => [
'type' => 'text',
],
'author' => [
'type' => 'text',
],
'tags' => [
'type' => 'text',
],
'tagss' => [
'type' => 'text',
],
];
}
<?php namespace Anomaly\Streams\Addon\Module\Resources\Installer;
use Anomaly\Streams\Platform\Stream\StreamInstaller;
/**
* Class ResourcesStreamInstaller
*/
class ResourcesStreamInstaller extends StreamInstaller
{
/**
* Stream field assignments.
*
* @var array
*/
protected $assignments = [
'title' => ['is_required' => true],
'slug' => ['is_required' => true],
'category' => ['is_required' => true],
'description' => [],
'author' => [],
'tags' => [],
'tagss' => [],
];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment