nethercore/csv-exporter

CSV Exporter for laravel

Installs: 4

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/nethercore/csv-exporter

1.0.1 2024-09-10 01:23 UTC

This package is auto-updated.

Last update: 2026-01-10 23:21:44 UTC


README

Installation via composer:

composer require nethercore/csv-exporter

Usage:

Generated files will appear in App/Exports/{name}Export.php

Use double backslashes for nested name or model files.

php artisan make:export {name} {model}

e.g php artisan make:export Wharehouse\\Product Stock\\Item will create app/Exports/Wharehouse/ProductExport.php using Models/Stock/Item.php inside the export file.

Example Code:

namespace App\Exports;

use App\Models\Product;
use Nethercore\CsvExporter\Interfaces\BaseExporterInterface;
use Nethercore\CsvExporter\Traits\StreamResponseTrait;
use Symfony\Component\HttpFoundation\StreamedResponse;

final class ProductExport implements BaseExporterInterface
{
    use StreamResponseTrait;
    ...
}
use App\Exports\ProductExport;

class ProductController extends Controller
{
    public function export()
    {
        return (new ProductExport('some product title'))->export());
    }
}