<?php // $file = /home/bluedoor/www/dev/wp-content/plugins/yooessentials/modules/source/providers/YouTube/config-channel.json

return [
  'name' => 'youtube_channel', 
  'title' => 'YouTube My Channel', 
  'description' => 'All videos (Private & Unlisted) from your channel via oAuth.', 
  'group' => 'Social Media', 
  'collection' => 'YouTube', 
  'icon' => $filter->apply('url', '~yooessentials_url/modules/source/providers/YouTube/icon.svg', $file), 
  'endpoints' => [
    'presave' => 'yooessentials/source/youtube'
  ], 
  'fields' => [
    'name' => [
      'label' => 'Name', 
      'description' => 'A name to identify this source.', 
      'attrs' => [
        'autofocus' => true, 
        'placeholder' => 'YouTube My Channel'
      ]
    ], 
    'account' => [
      'label' => 'Account', 
      'type' => 'yooessentials-connected-auth', 
      'connections' => [
        'google' => ['https://www.googleapis.com/auth/youtube.readonly']
      ], 
      'description' => 'The Google account which to authenticate with.'
    ], 
    'channel_id' => [
      'label' => 'Channel', 
      'type' => 'yooessentials-select-dropdown-async', 
      'description' => 'The YouTube Channel from which to create the source.', 
      'endpoint' => 'yooessentials/source/youtube/channels', 
      'watch' => 'account'
    ], 
    'cache_default' => $config->get('yooessentials.source.fields.cache_default_limited')
  ]
];
