oc-social-plugin/models/Setting.php

29 lines
658 B
PHP

<?php namespace Zoomyboy\Social\Models;
use Model;
use Zoomyboy\Social\Classes\FacebookService;
use Zoomyboy\Social\Classes\InstagramService;
/**
* Setting Model
*/
class Setting extends Model
{
public $implement = ['System.Behaviors.SettingsModel'];
public $settingsCode = 'zoomyboy_social';
public $settingsFields = 'fields.yaml';
public function getFacebookPagesOptions(): array
{
return app(FacebookService::class)->pages()->pluck('name', 'id')->toArray();
}
public function getInstagramUsersOptions(): array
{
return app(InstagramService::class)->pages()->pluck('name', 'id')->toArray();
}
}