bonnier / sitemanager-sdk
关于本包的最新版本(2.0.0)没有提供许可信息。
SiteManager 的 PHP SDK
2.0.0
2020-06-12 08:25 UTC
Requires
- php: >=7.3
- ext-json: *
- guzzlehttp/guzzle: ^6.3
- illuminate/support: ^7.15
Requires (Dev)
- fzaninotto/faker: ^1.8
- phpunit/phpunit: ^7.3
- vlucas/phpdotenv: ^4.1.7
This package is auto-updated.
Last update: 2024-09-19 22:23:16 UTC
README
安装
composer require bonnier/sitemanager-sdk
配置
请确保在 .env
文件中设置了 sitemanager 主机,或者将 SiteManager 主机传递给 SiteManager 构造函数
SITE_MANAGER_HOST=https://site-manager.test
或者
$siteManager = new SiteManager('https://site-manager.test');
使用方法
首先,您需要实例化 SiteManager 类
use Bonnier/SiteManager/SiteManager; $siteManager = new SiteManager();
然后,您就可以开始与 SiteManager 交互了
应用
// Retrieve a collection of all apps in SiteManager $siteManager->app()->getAll(); // Get a specific app from SiteManager $siteManager->app()->getById(1);
品牌
// Retrieve a collection of all brands in SiteManager $siteManager->brand()->getAll(); // Get a specific brand from SiteManager $siteManager->brand()->getById(1);
类别
// Retrieve a collection of all categories in SiteManager $siteManager->category()->getAll(); // Get a specific category from SiteManager $siteManager->category()->getById(1); // Get a specific category by its Contenthub ID from SiteManager $siteManager->category()->getByContenthubId('abc123'); // Get a collection of categories by a specific brand in from SiteManager $siteManager->category()->getByBrandId(1);
网站
// Retrieve a collection of all the sites in SiteManager $siteManager->site()->getAll(); // Get a specific site from SiteManager $siteManager->site()->getById(1);
标签
// Retrieve a collection of all the tags in SiteManager $siteManager->tag()->getAll(); // Get a specific tag from SiteManager $siteManager->tag()->getById(1); // Get a specific tag by its Contenthub ID from SiteManager $siteManager->tag()->getByContenthubId('abc123'); // Get a collection of tags by a specific brand from SiteManager $siteManager->tag()->getByBrandId(1);
词汇表
// Retrieve a collection of all the vocabularies in SiteManager $siteManager->vocabulary()->getAll(); // Get a specific vocabulary from SiteManager $siteManager->vocabulary()->getById(1); // Get a collection of vocabularies by a specific brand from SiteManager $siteManager->vocabulary()->getByBrandId(1)