PHP code example of redsquirrelstudio / laravel-backpack-export-operation

1. Go to this page and download the library: Download redsquirrelstudio/laravel-backpack-export-operation library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

redsquirrelstudio / laravel-backpack-export-operation example snippets


    'providers' => ServiceProvider::defaultProviders()->merge([
        /*
         * Package Service Providers...
         */
        //Some other package's service providers...
        RedSquirrelStudio\LaravelBackpackExportOperation\Providers\ExportOperationProvider::class,
    ])->toArray(),

class ExampleCrudController extends CrudController
{
    use \Backpack\CRUD\app\Http\Controllers\Operations\ListOperation;
    use \Backpack\CRUD\app\Http\Controllers\Operations\CreateOperation;
    use \Backpack\CRUD\app\Http\Controllers\Operations\UpdateOperation;
    use \Backpack\CRUD\app\Http\Controllers\Operations\DeleteOperation;
    use \Backpack\CRUD\app\Http\Controllers\Operations\ShowOperation;
    use \RedSquirrelStudio\LaravelBackpackExportOperation\ExportOperation;
    //...

    //Probably some more CRUD config...
    
    protected function setupExportOperation()
    {
        CRUD::addColumn([
           'name' => 'id',
           'label' => 'ID',
           'type' => 'number',
        ]);

        CRUD::addColumn([
           'name' => 'name',
           'label' => 'Name',
           'type' => 'text',
        ]);  
    }
    
    //Fetch functions or something...  

    //...
    protected function setupExportOperation()
    {
        $this->disableUserConfiguration();
    //...

    //...
    protected function setupExportOperation()
    {
        $this->queueExport();
    //...

    //...
    protected function setupExportOperation()
    {
        $this->setQueueMessage("Your Message about the export being queued.");
    //...

    //...
    //Filesystem disk to store export files
    'disk' => "s3",
    
    //Path to store export files
    'path' => "/2024/application-name/exports",
    //...

    //...
    //Queue to dispatch export jobs to
    'queue' => 'export-queue',
    //...

//...
return [
    'export_log_model' => ExportLog::class,
    //...

RedSquirrelStudio\LaravelBackpackExportOperation\Events\ExportCompleteEvent::class

[
    //The Completed Export
   'export_log' => RedSquirrelStudio\LaravelBackpackExportOperation\Models\ExportLog::class 
]

    public function setup()
    {
        //...
        CRUD::denyAccess('export');
        //...
    }
config/app.php
bash
php artisan vendor:publish --tag=laravel-backpack-export-operation-config
config/backpack/operations/export.php
bash
php artisan vendor:publish --tag=laravel-backpack-export-operation-migrations
bash
php artisan migrate
config/backpack/operations/export.php
config/backpack/operations/export.php
config/backpack/operations/export.php
bash
php artisan vendor:publish --tag=laravel-backpack-export-operation-translations
bash
php artisan vendor:publish --tag=laravel-backpack-export-operation-views