Giter Site home page Giter Site logo

eloquent-zoho's Introduction

CI

Eloquent Zoho

This package provides a rudimentary(aka, far from complete) implementation of the Zoho API as an Eloquent driver for Laravel, to enable the use of Zoho data models as eloquent models.

Database definitions in config/databases.php need to provide the following configuration values

'driver' => 'zoho',
'api_url' => // the URL for your Zoho workspace,
'api_email' => // the API  email for your Zoho workspace,
'workspace_name' => // The workspace name,
'folder_name' => // The folder where your tables are stored within Zoho.  This is used when manipulating data schemas using ZohoSchema
'auth_token' => // Your generated auth token, see below

The driver assumes that your database connection key is 'zoho'.

(E.g within config/database.php, you will define connections['zoho'] with your config).

Authentication

Your application must generate, and be responsbile for storing, an auth token prior to interacting with the API through the driver.

You can use the ZohoSchema facade to achieve this:

use Portable\EloquentZoho\Eloquent\Facades\ZohoSchema;
$authToken = ZohoSchema::generateAuthToken('zoho_user_email','zoho_user_password');

Database schema

You can create and manipulate Schemas as normal with the ZohoSchema facade:

use Portable\EloquentZoho\Eloquent\Facades\ZohoSchema;

ZohoSchema::hasTable('my_zoho_table')

// or

ZohoSchema::create('my_zoho_table', function(Blueprint $table){
    $table->id();
    $table->timestamps();
});

Model definitions

Models should be defined as a subclass of Portable\EloquentZoho\Eloquent\ZohoModel

Models currently support basic query, insert, update and delete, as well as upserts.

PRs Welcome!

As stated, this driver is rudimentary and was written for a specific use case. As such, much of the possible grammar is left unimplemented, and PRs are welcome.

eloquent-zoho's People

Contributors

kyoungportable avatar samlev avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.