PHPackages                             stats4sd/laravel-file-util - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. stats4sd/laravel-file-util

AbandonedArchivedLibrary[File &amp; Storage](/categories/file-storage)

stats4sd/laravel-file-util
==========================

Laravel File Utility Package

0.1.2(4y ago)1214[1 issues](https://github.com/stats4sd/laravel-file-util/issues)1MITPHPPHP ^8.0

Since Oct 14Pushed 3y ago1 watchersCompare

[ Source](https://github.com/stats4sd/laravel-file-util)[ Packagist](https://packagist.org/packages/stats4sd/laravel-file-util)[ Docs](https://github.com/stats4sd/fileutil)[ GitHub Sponsors](https://github.com/stats4sd)[ RSS](/packages/stats4sd-laravel-file-util/feed)WikiDiscussions main Synced yesterday

READMEChangelog (3)Dependencies (11)Versions (7)Used By (1)

Laravel File Utility Package
============================

[](#laravel-file-utility-package)

[![Latest Version on Packagist](https://camo.githubusercontent.com/41773f85c7441067560f756a3bfb8464db7509cf689ec47da0994108b823ff7e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73746174733473642f66696c657574696c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/stats4sd/fileutil)[![GitHub Tests Action Status](https://camo.githubusercontent.com/2864929a21415c51c5eadc7937e3bdde8c2fb155b05102dffd81ffc2239c3060/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f73746174733473642f66696c657574696c2f72756e2d74657374733f6c6162656c3d7465737473)](https://github.com/stats4sd/fileutil/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/cb2121d0ce10f5681f869ac700ce8ba361e3f0af5ebeb3ac43119d57fde1bbb7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f73746174733473642f66696c657574696c2f436865636b253230262532306669782532307374796c696e673f6c6162656c3d636f64652532307374796c65)](https://github.com/stats4sd/fileutil/actions?query=workflow%3A%22Check+%26+fix+styling%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/31f87c311ceeb99ea1eb3a88de766e5b1b8ecee093fcc947f37b560fe384d392/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73746174733473642f66696c657574696c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/stats4sd/fileutil)

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require stats4sd/laravel-file-util
```

Usage
-----

[](#usage)

#### Pre-requisite:

[](#pre-requisite)

The package has 3 main features, and you can use one or all of them in your project:

- A trait `HasUploadFields`: this is based heavily on the trait shipped with Laravel Backpack, but customised slightly to our needs.
    - To use the trait, you need no other dependencies.
- 2 Operation classes, to be used with Laravel Backpack.
    - To use these operations, you should install the following extra dependencies:
        - `composer require backpack/crud`
        - `composer require maatwebsite/excel`

1. Exporting Data through a Laravel Backpack Crud panel
-------------------------------------------------------

[](#1-exporting-data-through-a-laravel-backpack-crud-panel)

Both import and export operations use and require the [Laravel Excel](https://docs.laravel-excel.com/3.1) package.

The ExportOperation lets you link an ModelExport class built with Laravel Excel to your Crud panel.

How to add an Excel Export:

1. Build your ModelExport class as described [here](https://docs.laravel-excel.com/3.1/exports/)

- To test this operation class, start with the most basic version of an export (e.g. implement FromCollection and just get some items from your CRUD's model. You can always add things later to customise your export.

```
