Download the PHP package netsells/exportable without Composer

On this page you can find all versions of the php package netsells/exportable. 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 exportable

Exportable

Latest Version Total Downloads

Allows easy exporting of data from Eloquent models

It is created and maintained by the Netsells team

Getting Started

Install Exportable using Composer.

Implementation

This implementation of Exportable makes exporting data from Eloquent models to CSV or PDF formats simple. Simply extend the Netsells\Exportable\ExportableModel base class included in the package for any Eloquent model that needs to use the export functionality.

ExportableModel

The base class for the exportable model implements and satisfies the ExportableContract interface that can be applied to other classes. The two traits that perform the exporting of data are imported here as well.

The two core methods for exporting data are as follows:

public static function exportToPdf

public static function exportToCsv

The remaining two methods in the class are used to build the layout closure used by Csvme to export the data to CSV format and retrieve constants safely should they be used to provide routes to config or views.

public static function getLayoutClosure

public static function getConstant

Basic Usage

PDF

Exporting data to PDF format requires a view to format the output, the data to be exported and a list of headers. An example view is included with the package and custom views can easily be applied where desired.

CSV

Exporting data to CSV format simply needs the data and headers, if any, that are needed for the output. No special formatting is required since it is a CSV.

Advanced Usage

Included in the package is a exportable.php file that contains the bare bones to set up data that can be used to set up the export to CSV or PDF formats. This can be modified to suit your requirements, with multiple sections for different exports.

Example

For simplicity you can add the paths to each config as constants on the model.

Using the getConstant static method, the value of the constant can be retrieved. This method returns null if the constant is not found on the class. Using the value of the constant, the required config data can be used to export the data, as shown below.

Built With

License

This project is licensed under the MIT License - see the LICENSE.md file for details


All versions of exportable with dependencies

PHP Build Version
Package Version
Requires netsells/csvme Version ^1.1
dompdf/dompdf Version ^0.8.2
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 netsells/exportable contains the following files

Loading the files please wait ....