GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - allanvb/nova-exports: Package that allow you to export Laravel Nova resources.

BranchesTags
Open more actions menu

Latest commit

 

History

13 Commits
13 Commits

Folders and files

NameName
Last commit message
Last commit date
src
src
 
 
CHANGELOG.md
CHANGELOG.md
 
 
LICENCE
LICENCE
 
 
README.md
README.md
 
 
composer.json
composer.json
 
 

Repository files navigation

Laravel Nova package to export resources

Packagist Version GitHub last commit License Sonar

This package adds and universal export action to your nova application.

Requirements

  • laravel/nova: ^3.0
  • gobrightspot/nova-detached-actions: ^1.1
  • optimistdigital/nova-multiselect-field: ^2.0
  • kpolicar/nova-date-range: dev-master
  • rap2hpoutre/fast-excel: ^2.5

Usage

To use the export action, you must add it to actions method of your resource.

use Allanvb\NovaExports\ExportResourceAction;

public function actions(Request $request): array
{
    return [
        new ExportResourceAction($this),
    ];
}

Available methods

  • only(array $columns) - Define whitelist of fields that can be exported.
  • except(array $columns) - Excludes the given fields from exporting list.
  • filename(string $name) - Sets the download filename.
  • withUserSelection() - Enables multi-select field that allow user to select the columns when exporting.
  • usesDateRange(string $columnName) - Enables field that allow user to select the range of dates when exporting. Default: created_at
  • usesGenerator() - Enables cursor usage when getting data from database.
  • queryBuilder(callable $query) - Use own query on data exportation.
  • disk(string $disk) - The storage you want to use for storing export files.

withUserSelection method cannot be used together with queryBuilder method.

You are also able to use all of Nova Action methods, and all of Detached Actions methods on ExportResourceAction.

Exceptions

The package can throw the following exceptions:

Exception Reason
ColumnNotFoundException Column does not exist in given table.
EmptyDataException No records to export.
RangeColumnNotDateException Given column for date range is not a date.

To do

  • Export single resource
  • Implement user selection export
  • Implement generator on exporting
  • Add way to perform joins on export
  • Add Eloquent relations export
  • Add option to export to PDF

License

The MIT License (MIT). Please see License File for more information.

About

Package that allow you to export Laravel Nova resources.

Topics

excelexport-excellaravelnova

Resources

Readme
MIT license
Activity

Stars

2 stars

Watchers

1 watching

Forks

5 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.