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

return [
  'name' => 'google_mybusiness', 
  'title' => 'Google Business Profile', 
  'description' => 'Source based on Google Business Profile.', 
  'group' => 'misc', 
  'icon' => $filter->apply('url', '~yooessentials_url/modules/source/providers/GoogleBusinessProfile/icon.svg', $file), 
  'endpoints' => [
    'presave' => 'yooessentials/source/google-business-profile'
  ], 
  'fields' => [
    'name' => [
      'label' => 'Name', 
      'description' => 'A name to identify this source.', 
      'attrs' => [
        'autofocus' => true, 
        'placeholder' => 'Google Business Profile'
      ]
    ], 
    'account' => [
      'label' => 'Account', 
      'type' => 'yooessentials-connected-auth', 
      'connections' => [
        'google' => ['https://www.googleapis.com/auth/business.manage']
      ], 
      'description' => 'The Google account which to authenticate with.'
    ], 
    'businessAccount' => [
      'label' => 'Profile', 
      'type' => 'yooessentials-select-dropdown-async', 
      'description' => 'The Google Business Profile from wich to retrieve the locations.', 
      'endpoint' => 'yooessentials/source/google-business-profile/accounts', 
      'watch' => 'account'
    ], 
    'location' => [
      'label' => 'Location', 
      'type' => 'yooessentials-select-dropdown-async', 
      'description' => 'The profile location from which to create the source.', 
      'endpoint' => 'yooessentials/source/google-business-profile/locations', 
      'watch' => 'businessAccount'
    ], 
    'cache_default' => $config->get('yooessentials.source.fields.cache_default_limited')
  ]
];
