Laravel wrapper package for php ext-xlswriter extension.
composer require rizky92/laravel-xlswriter
use Rizky92\Xlswriter\ExcelExport;
use App\Models\User;
$users = User::all(['id', 'username', 'created_at']);
$columnHeaders = ['User ID', 'Username', 'Registration date'];
$excel = ExcelExport::make('users.xlsx', 'Sheet 1')
->setBasePath('excel/users')
->setDisk('public')
->setColumnHeaders($columnHeaders)
->setData($users);
return $excel->export();
TBA
MIT