承接 nero/backpack-export 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

nero/backpack-export

最新稳定版本:0.5

Composer 安装命令:

composer require nero/backpack-export

包简介

README 文档

README

There is a problem with exporting data from pages in Backpack, it exports only the data that you see on page, and it's limited up to 100 rows.

So the main purpose of this package is to allow you to export not only data you see on page but all rows. Also, it works even if you have applied filters.

The export based on job. After the export (job) is done, it will send a letter to user's email. But if you want, you can override this logic and set your own Notification class, it can be done with changing config (backpack_export.php).

I recommend to check the config out, it can be found in config of your application (config/backpack_export.php)

Install

To install this package, you have to run this command:

composer require nero/backpack-export

Next step is to run:

php artisan vendor:publish --provider="Nero\BackpackExport\Application\ExportServiceProvider"

As result of command, there will be 2 files added in your application:

  1. in app/config, there will be backpack_export.php config
  2. in your resource/views/vendor/backpack/crud/inc, there will be export_buttons.blade.php

How to use

After installing you have to make 3 steps:

  1. Go to the crud class where you want to enable an export
  2. Include Nero\BackpackExport\Application\Traits\ExportOperation trait. Example:
use \Nero\BackpackExport\Application\Traits\ExportOperation;
  1. Go to the setupListOperation and call enableAdvancedExportButtons method:
    protected function setupListOperation()
    {
        $this->enableAdvancedExportButtons();
        // ...
    }

IMPORTANT: You MUST call either $this->crud->enableExportButtons(); or $this->enableAdvancedExportButtons();, but not both!

It's done!. Now you can export all data from table, not only the displayed ones

Uninstall

Uninstalling process is not complicated. It consists of two steps:

  1. removing package from composer
  2. removing config, views and language files

To remove package, execute this command

composer remove nero/backpack-export

Then we have to delete config. It can be found in config, full path config/backpack_export.php:

rm config/backpack_export.php

Now we have to delete export_buttons.blade.php. It can be found as resource/views/vendor/backpack/crud/inc/export_buttons.blade.php:

rm resource/views/vendor/backpack/crud/inc/export_buttons.blade.php

As last step is deleting language packages:

rm resources/lang/en/backpack_export.php
rm resources/lang/ru/backpack_export.php

TODO

  • Write a better documentation
  • Make PDF compatibility
  • Improve handling custom_html columns
  • Refactoring code
    • Fix fetch in view (list.blade.php)
    • Remove unnecessary code
  • Convert date format in row ("Monday 11 December 2023 14:00:00") to application chosen format
  • Agility to except any columns from export

统计信息

  • 总下载量: 5
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-12-11