Download the PHP package midoelhawy/laravel-query-to-csv without Composer

On this page you can find all versions of the php package midoelhawy/laravel-query-to-csv. 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-query-to-csv

Laravel Export To CSV natively in MySQL

Supports Laravel 7 and above

Many applications require an export to csv functionality. It's implemented in variety of ways, however many of us face a performance bottleneck when the data to be exported is very huge. PHP application may consum lot of memory resources for each export.

This package is a solution for it where it uses MySQL's SELECT INTO OUTFILE approach. The entire export is performed by MySQL natively. It's extrmely efficient, quick. It eliminates overhead from PHP application utilizing memory to pass selected the query collection for generating CSV. This is extremely handy for systems having large set of rows (like ~1,00,000 row count) of data exported on frequent basis.

If you worry that you need to pass raw queries for it, do not worry. We have got you covered :). You can pass the query builder and it will do the rest internally without causing you an extra overhead.

PS : It work's for local database server. The features for remote database server will be added shortly.

Installation

Install via composer

Register the service Provider

Add service provider to config/app.php in providers section

Set up package configuration

After executing following command, you will have querytocsv.php in config folder

Configurations

The package can be configured from config/querytocsv.php

  1. 'default-folder' => 'csvexport'

Takes a string which will be the default folder name inside storage folder, where exports will be kept. This can be changed dynamically for every export as explained in further usase section

  1. 'add-timestamp' => true

Take a boolean. If set to true, it will add timestamp to the csv file name you have specified, if set to false it won't

  1. 'enable-logging' => true

It's suggested to set this to true in development environments OR on production if you really need it. When set to true, it will add a log entry in following format for each export in log file storage/logs/querytocsv.log

[2020-12-10 13:38:48] local.INFO: Export Execution Time : 1556.09 milliseconds | File : /storage/csvexport/employees1514122727.csv

  1. 'addlog-row-count' => true

It's suggested to set this to true in development environments OR on production if you really need it. When set to true, it will add the count of rows for each export. This will be useful only when 'enable-logging' is set to true.

[2017-12-24 13:38:48] local.INFO: Export Execution Time : 1556.09 milliseconds | File : /storage/csvexport/employees1514122727.csv | Row Count : 50433

Usage

  1. Using Eloquent for export :

  2. Using DB Facade :

  3. Using RAW Query :

Security

We have got you covered from common SQL Injections if you use setRawQuery() method. However if you still discover any issue related to security, please connect back at [email protected]

Credits


All versions of laravel-query-to-csv with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6.4
illuminate/support Version >=5.0
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 midoelhawy/laravel-query-to-csv contains the following files

Loading the files please wait ....