Download the PHP package redsquirrelstudio/laravel-backpack-export-operation without Composer

On this page you can find all versions of the php package redsquirrelstudio/laravel-backpack-export-operation. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-backpack-export-operation

Export Operation for Backpack for Laravel

Latest Version on Packagist

Adds a configurable interface that allows your admin users to:

and allows you as the developer to:

If you're looking for a great team of developers to handle some Backpack/Laravel development for you, drop us a line at Sprechen

Also need imports for your CRUD? Check out redsquirrelstudio/laravel-backpack-import-operation

Screenshot of the operation's configuration screen

Powering the exports in the background is

Table of Contents

  1. Installation
  2. Usage
  3. Disabling User Configuration
  4. Queued Exports
  5. Configuration
    1. File Storage
    2. Queues
    3. Changing the Export log Model
    4. Customising Translations
    5. Customising Views
  6. Export Completed Event
  7. Restricting Access
  8. Credits
  9. License

Installation

Environment Requirements

Step 1.

Require the package with composer:

This will also install if it's not already in your project.

Step 2. (Optional)

If you would like to add the option to export PDFs, you should also install dompdf:

Step 3. (Optional)

The service provider at: will be auto-discovered and registered by default. Although, if you're like me, you can add it to your .

Step 4.

Publish the config file:

This will create a new file at allowing you to customise things such as the disk and path exported files should be stored at.

Step 5.

Publish and run the migration:

Then

Usage

In your CRUD Controller where you need the export operation.

Wait for it...

Add the export operation:

But wait! There's more!

Configuring the Export

Configuring the export is exactly the same as how you would configure the list operation. Simply define which columns you would like to export, here's an example:

Pretty much all columns that are available for the list operation will work fine in an export. This also means you can define your own columns in the exact same way as you would with list columns.

For a list of available column types, see Backpack for Laravel's Documentation

Disabling User Configuration

Sometimes, you may not want the user to be able to choose which columns are included in their export, In these cases, you can disable the user configuration step.

To enable this behaviour, add this one line of code to the function:

Queued Exports

In most situations, it is going to be better for the user if your exports are processed in the background rather than making them wait for the export to finish processing.

Therefore, you have the option to queue your exports by adding this line of code to the function:

When this option is enabled, you will need to handle what happens when the export finishes or the user will not receive their export. To do this, you should handle the using an event listener. This event contains the export log which you can get the file path from to send to the user via email, notification etc.

Read about the export complete event here

Learn how to handle events on Laravel's official Docs

Of course, for this to work, you will need to set up a queue for your application to dispatch jobs to, to do that, follow Laravel's official docs.

When this setting has been enabled, the user will be redirected to the current CRUD's list view. An alert will appear in the top right which has a default message.

If you would like to change this message, add the following line to the function:

Configuration

File Storage

By default, export files will be stored in your default disk at the path /exports. but this can be altered either by changing the following env variables:

Or by directly changing the options within .

Queues

You can also change the queue that queued exports are dispatched to by changing the following env variables:

or changing the value directly within .

Export Log

In very rare cases, you may wish to also change the model that is used to log exports, I can't think of a reason why, but I'm sure someone will come up with one.

If you do, make sure to update the migration, and specify your own model at .

Translations

You can update the operation translations if required. To do this run:

this will publish the operation lang files to The files stored in this directory take priority over the package's default lang files.

Views

You can update the operation views if required. To do this run:

this will publish the operation blade files to The files stored in this directory take priority over the package's default views.

Export Completed Event

This package fires an event when an export has been completed. The event payload contains the export log so that you can send an email, notification or whatever else with a download url for the file.

Event Class:
Payload:

Restricting Access

Like most operations in Backpack, you can restrict user access using the following line of code in your CRUD Controller's setup function:

Credits

License

MIT. Please see the license file for more information.


All versions of laravel-backpack-export-operation with dependencies

PHP Build Version
Package Version
Requires backpack/crud Version ^5.0|^6.0
maatwebsite/excel Version ^3.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package redsquirrelstudio/laravel-backpack-export-operation contains the following files

Loading the files please wait ....