Download the PHP package sands/laravel-presenter-excel without Composer
On this page you can find all versions of the php package sands/laravel-presenter-excel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sands/laravel-presenter-excel
More information about sands/laravel-presenter-excel
Files in sands/laravel-presenter-excel
Package laravel-presenter-excel
Short Description Laravel Presenter plugin to respond with MS Excel files: XLSX, XLS and CSV.
License MIT
Informations about the package laravel-presenter-excel
Sands\Presenter\Excel
Sands Laravel Presenter plugin to respond with MS Excel files: XLSX, XLS and CSV. Files are generated using the awesome Laravel Excel package.
Installation
Make sure Sands\Presenter has been properly installed.
In config/app.php
add Sands\Presenter\Excel\ExcelPresenterServiceProvider
after the Sands\Presenter\PresenterServiceProvider
inside the providers
array:
Usage
This plugin allows you to easily create XLSX, XLS and CSV exports.
Let's say you have a UsersController with the below method:
When the user visits /users?format=xlsx
, they will be prompted to download the User Reports.xlsx
file.
When the user visits /users?format=xls
, they will be prompted to download the User Reports.xls
file.
When the user visits /users?format=csv
, they will be prompted to download the User Reports.csv
file.
Data Format for XLSX and XLS
Data for XLSX and XLS must be a nested collection as per example below:
Data Format for CSV
Data for CSV must be as collection per example below:
File Properties
File properties can be set using the setOption
method. Properties available are as per defined here.
The export file name can be changed via the excel.fileName
option.
MIT License
Copyright (c) 2016 Sands Consulting Sdn Bhd
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.