PHP code example of tu6ge / voyager-excel

1. Go to this page and download the library: Download tu6ge/voyager-excel 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/ */

    

tu6ge / voyager-excel example snippets




namespace YourApp;

use Tu6ge\VoyagerExcel\Exports\AbstractExport;

class MyCustomExport extends AbstractExport
{
    protected $dataType;
    protected $model;

    public function __construct($dataType, array $ids)
    {
        $this->dataType = $dataType;
        $this->model = new $dataType->model_name(); // this is current Model instance
        // $ids is user selected record ids 

        // write your own idea
    }
}