Download the PHP package stats4sd/laravel-file-util without Composer

On this page you can find all versions of the php package stats4sd/laravel-file-util. 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-file-util

Laravel File Utility Package

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Installation

You can install the package via composer:

Usage

Pre-requisite:

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

1. Exporting Data through a Laravel Backpack Crud panel

Both import and export operations use and require the Laravel Excel 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

    • 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.
  2. Use your ModelExport class in your CrudController: use App\Exports\TagsExport;

  3. Use the ExportOperation in your CrudController: use \Stats4sd\FileUtil\Http\Controllers\Operations\ExportOperation;

  4. Add the following in your CrudController: use ExportOperation;

  5. Add the following to your CrudController's setup() method: CRUD::set('export.exporter', YourModelExport::class); (replace with the actual name of your ModelExport class)

That's it! The operation adds an "Export" button to the 'top' stack in List view. Click the button to download the File generated from your ModelExport class.

Notes:

Everything about the exported file is defined by the ModelExport class. You can customise it using any of the features of Laravel Excel as you would if you were using the package anywhere else in Laravel. All this Operation does is make it easier to quickly link an ModelExport class to a Crud panel.

2. Importing Data through a Laravel Backpack Crud panel

The ImportOperation lets you link an ModelImport class built with Laravel Excel to your Crud panel.

How to add:

  1. Build your ModelImport class as described here

  2. Build your ImportRequest class as below

  3. Use your ModelImport class in your CrudController: use App\Imports\TagsImport;

  4. Use the ImportOperation in your CrudController: use \Stats4sd\FileUtil\Http\Controllers\Operations\ImportOperation;

  5. Add the following in your CrudController: use ImportOperation;

  6. Add the following to your CrudController's setup() method: CRUD::set('import.importer', YourModelImport::class); (replace with the actual name of your ModelImport class)

That's it! The operation adds an "Import" button to the 'top' stack in List view. Click this button to be taken to the Import View. This view contains a basic form with a file upload input and a submit button. Add an Excel file, submit, and the file will be processed by your ModelImport class.

Notes:

TO DO: add examples of validation with both ToModel / BatchInserts AND ToCollection concerns

3. File Upload + File Download Operations

  1. Use FileController class in your routes\web.php: use \Stats4sd\FileUtil\Http\Controllers\FileController;

  2. Add below section in your routes\web.php

  3. In config\filesystem.php, add a line to "disks" \ "local" section 'url' => env('APP_URL').'/download/',

  4. Use HasUploadFields class in your Model class: use \Stats4sd\FileUtil\Models\Traits\HasUploadFields;

  5. Use trait HasUploadFields class in your Model class: use CrudTrait, HasUploadFields;

  6. Add below function to your Model class, it will save uploaded files into folder "storage\app\site". File name will be stored in Model class column "files"

  7. Add the following to your CrudController's setupCreateOperation() method: CRUD::field('files')->type('upload_multiple')->disk('local')->upload(true)->label('Files or charts for the site')->hint('If you have charts or other files, please upload them here');

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

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


All versions of laravel-file-util with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
spatie/laravel-package-tools Version ^1.4.3
illuminate/contracts Version ^8.37
maatwebsite/excel Version ^3.1
prologue/alerts Version ^0.4.1
intervention/image Version ^2.5
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 stats4sd/laravel-file-util contains the following files

Loading the files please wait ....