Using Google Excel with Eloquent Queries

Eloquent Sheets is a package by Ed Grosvenor that allows you to work with Google Sheets on Eloquent models:

This package provides a Eloquent model located on a Google Excel. There are two things your page must have to work. One of them is a header row that holds the name of your columns. By default, this comes to row 1 (top row), but it can be any row on the page. The other is the primary key column. Eloquent assumes that your primary key column is named id. If not, adjust your model according to the columns in Excel.

When we make the model class that you create, it is similar to the following example:

use Grosv\EloquentSheets\SheetModel;class YourGoogleSheetsModel extends SheetModel
{
// The id of the spreadsheet
protected $spreadsheetId = '1HxNqqLtc614UVLoTLEItfvcdcOm3URBEM2Zkr36Z1rE';
// The id of the sheet within the spreadsheet (gid=xxxxx on the URL)
protected $sheetId = '0';
// The row containing the names of your columns (eg. id, name, email, phone)
protected $headerRow = '1';
}

With the Google Excel model, you can use effective features; however, the model can currently use only reading and listing methods. Updating and adding won't work, but this package provides a way to read page data through Eloquent. Add and update features can be added in new versions.

If you want to know more about this package, see GitHub at grosv/eloquent-sheets.

  Quote

KARABAY A, 2020 . Using Google Excel with Eloquent Queries,

https://www.karabayyazilim.com/blog/google-exceli-eloquent-sorgulari-ile-kullanma-2020-03-20-223520

(Accessed March 20, 2020).


  Share this post

Comments (0)

Comment

Subscribe
Sign up for the email newsletter to be the first to know about my blog posts