PHP code example of stianscholtz / query-exporter
1. Go to this page and download the library: Download stianscholtz/query-exporter library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
stianscholtz / query-exporter example snippets
use Stianscholtz\QueryExporter\QueryExporter;
use DB;
$query = DB::table('your_table')
->select('column1', 'column2')
->where('condition', 'value');
QueryExporter::forQuery($query)
->filename('my-file')
->headers(['Column 1', 'Column 2'])//Optional, selected columns in query will be used as default headers.
->export();