便携式 / eloquent-zoho
此软件包最新版本(v1.0.10)没有可用的许可证信息。
Zoho Analytics的简单Eloquent驱动程序
v1.0.10
2023-09-27 06:21 UTC
Requires
- php: ^8.1
Requires (Dev)
- guzzlehttp/guzzle: ^7.8
- guzzlehttp/promises: ^2.0
- laravel/pint: ^1.12
- nunomaduro/larastan: ^2.6
- orchestra/testbench: ^8.10
- pestphp/pest: ^2.19
- pestphp/pest-plugin-laravel: ^2.2
- squizlabs/php_codesniffer: ^3.7
README
Eloquent Zoho
此软件包提供了一个基本的(即远未完整)Zoho API实现,作为Laravel的Eloquent驱动程序,以使用Zoho数据模型作为eloquent模型。
在 config/databases.php
中的数据库定义需要提供以下配置值
'driver' => 'zoho',
'host' => // the base URL for your Zoho workspace, e.g. 'bi.myorg.com',
'port' => // Usually 443, assuming you have SSL for your workspace,
'username' => // the API email for your zoho workspace,
'database' => // The workspace name,
'prefix' => // The folder where your tables are stored within Zoho. This is used when manipulating data schemas using ZohoSchema
'email' => // Your *user* email, used for generating tokens
'password' => // Your *user* password, used for generating tokens
驱动程序假设您的数据库连接密钥为'zoho'。
(例如,在 config/database.php
中,您将使用配置定义 connections['zoho']
)。
数据库模式
您可以使用 ZohoSchema
门面像通常一样创建和操作模式。
use Portable\EloquentZoho\Eloquent\Facades\ZohoSchema;
ZohoSchema::hasTable('my_zoho_table')
// or
ZohoSchema::create('my_zoho_table', function(Blueprint $table){
$table->id();
$table->timestamps();
});
模型定义
模型应定义为 Portable\EloquentZoho\Eloquent\ZohoModel
的子类。
模型目前支持基本的查询、插入、更新和删除,以及upserts。
欢迎PRs!
如上所述,此驱动程序是基本的,并针对特定用例编写的。因此,许多可能的语法尚未实现,欢迎提交PRs。