Download the PHP package grosv/eloquent-sheets without Composer

On this page you can find all versions of the php package grosv/eloquent-sheets. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package eloquent-sheets

Eloquent Models for your Google Sheets

A package that lets you lay Eloquent on top of a Google Sheet.

Latest Version on Packagist StyleCI Build Status

This package provides an Eloquent model that sits on top of a Google Sheet. You can use a heading row that holds the name of your columns. This defaults to row 1 (the top row) but it can be any row in the sheet. Or you can define an array of headings in your model. If you choose not to have a primary key column in your spreadsheet, each column will get an id (or whatever you're calling your primary key column in your model) auto-incremented.

When you use this package, an initial invocation of the model will read the sheet and store each row as a record in a table inside a file-based sqlite database. Subsequent invocations of the model use that sqlite database so changes to the spreadsheet won't be reflected in the database. However, there are two ways that you can invalidate the sqlite cache and cause it to be recreated:

  1. You can call the invalidateCache() method on the model with something like like YourGoogleSheetModel::first()->invalidateCache()

  2. A macro that you can attach to your Google sheet. The macro listens for edits within the sheet and when one happens, it sends a request to a route provided by this package that deletes the sqlite database forcing a fresh load the next time the model is used.

Installation

Configuration

This package relies on revolution/laravel-google-sheets. You must handle the configuration for that package and its dependencies for this package to work. Follow the instructions in their readme (though you can skip the composer require bit because I do that already in here).

Usage

Consider the following Google Sheet. We want to lay an Eloquent model on top of it.

Screen Shot 2020-03-03 at 3 02 15 PM

Step 1 - Enter the full path to the directory where you want to create the model file (defaults to app_path()):

Screen Shot 2020-03-11 at 4 48 48 PM

Step 2 - Enter the name you want to use for your model class:

Screen Shot 2020-03-03 at 3 11 10 PM

Step 3 - Paste the edit url of your Google Sheet from the browser address bar:

Screen Shot 2020-03-03 at 3 13 33 PM

Step 4 - Confirm that the path and full classname look right:

Screen Shot 2020-03-03 at 3 14 47 PM

Step 5 - And you will receive the template of a macro that you can attach to your sheet that will tell your site that the sheet has changed so a new cache has to be built.

Screen Shot 2020-03-03 at 3 20 58 PM

You can use something like this to enable the macro generated on your sheet as an installable trigger:

The Resulting Model Class

This model can do your basic Eloquent model stuff because it really is an Eloquent model. Though it's currently limited to read / list methods. Update and insert don't currently work because you do those things by editing your spreadsheet.

What's Missing

Eventually I'd like to add insert and update methods that will let you append rows to your spreadsheet and edit existing rows. I already have the most important part done... a method to invalidate the cache when we update or insert. Now I just need the update and insert methods.

Acknowledgements

This package wouldn't be possible without Sushi by Caleb Porzio. If you're not sponsoring him on GitHub you should.


All versions of eloquent-sheets with dependencies

PHP Build Version
Package Version
Requires php Version ^7.3
illuminate/support Version >=6.0
revolution/laravel-google-sheets Version ^5.0
calebporzio/sushi Version ^2.0
ext-json Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package grosv/eloquent-sheets contains the following files

Loading the files please wait ....