Download the PHP package schenke-io/laravel-sheet-base without Composer

On this page you can find all versions of the php package schenke-io/laravel-sheet-base. 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 laravel-sheet-base

Laravel Sheet Base

Latest Version on Packagist GitHub Tests Action Status Total Downloads

The Laravel Sheet Base package simplifies data processing by offering a collection of classes specifically tailored for building efficient data conversion pipelines. These pipelines are well-suited for scenarios where data modifications occur infrequently.

Here are some ideal use cases for this package:

These pipelines involve reading data from endpoints on one end and processing & storing it using a writer on the other. Each pipeline uses a schema to define the table format for the writer.

The Laravel Sheet Base package simplifies managing and transforming data in your Laravel applications. It offers several useful features:

The package utilizes a flexible and extensible pipeline architecture, making data management tasks efficient and straightforward.

Supported Readers

Supported Writers

The package includes versatile writers capable of handling various file formats:

Additionally, all written files that support comments include remarks about the reference file, discouraging direct editing.

Schema building blocks

Here are the three basic building blocks for creating a schema:

Pipeline Pumping Process

Here's the breakdown of how a pipeline pumps data:

Pipeline execution:

Installation

You can install the package via composer:

You can install the config file with:

Configuration

Filesystem

Configure the default disk in config/filesystems.php. Define a new disk sheet-base and specify its location. This will become the default place for files to be read and write.

Pipelines

Configure the pipelines in config/sheet-base.php. Under the primary key pipelines add names for each pipeline and define these 3 keys:

key purpose type
sources where does the data comes from array of strings of classes or filenames
schema schema of columns in output table class name
target where does the data goes to string of class or filename
filter list of ids which the pipeline should allow to pass string of class or filename
sync syncs data back to Google Sheets boolean true / false

Schema

Each pipeline has a Schema, which defines the columns of the written file. Create a schema by:

Here a simple example of a Schema class:

Schema columns

The following columns are possible:

method definition can be null is ID
addId numeric or string id yes yes
addDot text id with dots like 'alpha.beta.gamma' yes yes
addClosure allows for custom formatting function using column name and data row as input yes no
addUnsigned - yes no
addUnsignedNotNull - no no
addFloat - yes no
addBool - no no
addString - no no
addLanguage valid language code as name yes no
addNullString - yes no
addDateTime - yes no

For the two possible ID columns addId and addDot the following applies:

Here an example of the addClosure method:

Endpoints

A pipeline defines data flow between two designated points, called endpoints. You can define these endpoints in many ways.

Accessing Files

There are two ways to access files:

Extending Existing Classes

Create a class that inherits from one of the provided endpoint classes. Each extended class must define in $path a path to the file. The used disk can be overwritten in $disk as well.

Using Filename Extensions

Define a file with a specific extension, associated with the desired endpoint behavior. The file is located at the sheet-base $disk.

and the class for it:

Extension and endpoints
extension documentation reader writer
csv comma seperated values EndpointReadCsv EndpointWriteCsv
json JavaScript Object Notation - EndpointWriteJson
neon Nette Object Notation EndpointReadNeon EndpointWriteNeon
php PHP config file - EndpointWritePhp
psv pipe seperated values EndpointReadPsv EndpointWritePsv
tsv tab seperated values EndpointReadTsv EndpointWriteTsv
txt text files with just keys one per line EndpointReadTxt EndpointWriteTxt
yaml YAML config file EndpointReadYaml EndpointWriteYaml
yml YAML config file EndpointReadYml EndpointWriteYml

Endpoints as array

The array endpoints, EndpointReadArray and EndpointWriteArray, allow for programmatic access to other data, such as Eloquent models, APIs, or special data formats. ``

Endpoint to write language files

One pipeline can be used to write language php files. You need a special schema and target file. ``

Endpoint to read Google Sheets

First get a service account in the Google api console and download the json file. Then add the key GOOGLE_APPLICATION_CREDENTIALS to the .env file and fill the path to this file.

Create an empty Google sheets document and share it with the email from the service account.

There are two ways to configure the spreadsheet ID used by this plugin:

In both cases you fill the worksheet name in $sheetName and get than the URL of the Google sheet. The spreadsheet ID is the part of the URL after /d/ and before /edit. For example, in the URL https://docs.google.com/spreadsheets/d/123ABC-xyz123/edit, the spreadsheet ID is 123ABC-xyz123.

In $spreadsheetId you enter either the ID itself or the name of the key in config/sheet-base.php as shown below.

The first row in the spreadsheet must contain the column names, as specified in the pipeline schema. The table width is determined by the number of columns with header values. Additional headers to the right are ignored. Data reading stops when the first column is empty, and subsequent rows are discarded.

Verify the configuration

You can check the configuration after any edit with:

Pumping

You can pump data through the pipelines with this command:

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-sheet-base with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
google/apiclient Version ^2.10
illuminate/contracts Version ^11.33|^12.0
nette/neon Version ^3.4
spatie/laravel-data Version ^4.0
spatie/laravel-package-tools Version ^1.0
spatie/simple-excel Version ^3.3
symfony/yaml Version ^6.0|^7.1
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 schenke-io/laravel-sheet-base contains the following files

Loading the files please wait ....