PHPackages                             sowrensen/wormhole - 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. sowrensen/wormhole

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

sowrensen/wormhole
==================

Plug and play file uploader for Laravel applications.

v2.1.2(5y ago)0610MITPHPPHP &gt;=7.0

Since Jul 18Pushed 5y ago1 watchersCompare

[ Source](https://github.com/sowrensen/Wormhole)[ Packagist](https://packagist.org/packages/sowrensen/wormhole)[ Docs](https://github.com/sowrensen/Wormhole)[ RSS](/packages/sowrensen-wormhole/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (2)Versions (10)Used By (0)

Wormhole
========

[](#wormhole)

> Plug and play file uploader for Laravel applications.

Wormhole is a package for Laravel applications that provides a couple of methods which can be used to upload file and store them to different location in server. Make no mistake, Laravel itself provides very convenient way to upload file, and this package is using nothing but Laravel's `Storage` class under the hood. The difference is, methods provided here can be used for multiple purposes. I find myself copying and pasting same code on all of my projects and so I thought to put these methods in a package. Nothing fancy!

**Plus**, there is a Vue component included with progress bar to show file uploading progress and with configurable front-end validation, which can be published if anyone wants.

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

[](#installation)

To install the package run,

```
composer require sowrensen/wormhole
```

Usage
-----

[](#usage)

There are three methods provided in this package.

#### 1. saveFile

[](#1-savefile)

Use this method to store any binary file. It takes one mandatory and two optional parameters. After successful operation, an auto-generated file name will be returned, you should store this for future use.

ParameterTypeRequiredDefaultDescription`$file`\\Illuminate\\Http\\UploadedFileYesThe file to be uploaded, like, `$request->file('file')`.`$directory`stringNofilesThe directory name in which the file should be stored.`$disk`stringNopublicThe Laravel disk name in which the file should be stored.##### Returns

[](#returns)

The auto-generated file name.

##### Example

[](#example)

```
 $filename = \Wormhole::saveFile($request->file('avatar'), 'avatars', 'public');
```

#### 2. saveBase64File

[](#2-savebase64file)

Use this method to store any Base64 encoded file. An example use case of Base64 encoded file when you resize and crop an image in a canvas before uploading. The second and third parameters are same as `saveFile` method. After successful operation, an auto-generated file name will be returned, you should store this for future use.

ParameterTypeRequiredDefaultDescription`$data`stringYesBase64 string, pass like `$request->input('file')`.`$directory`stringNofilesThe directory name in which the file should be stored.`$disk`stringNopublicThe Laravel disk name in which the file should be stored.##### Returns

[](#returns-1)

The auto-generated file name.

##### Example

[](#example-1)

```
 $filename = \Wormhole::saveBase64File($request->input('avatar'), 'avatars', 'public');
```

#### 3. deleteFile

[](#3-deletefile)

This method takes one mandatory parameter and one optional parameter.

ParameterTypeRequiredDefaultDescription`$filename`stringYesName of the file to be removed (Required)`$directory`stringNofilesName of the directory where the file resides.`$disk`stringNopublicThe Laravel disk name in which the file is stored.##### Returns

[](#returns-2)

`true` or `false` depending on operation status.

##### Example

[](#example-2)

```
 \Wormhole::deleteFile('eJd5m08f_1597305889.png', 'avatars', 'public');
```

Vue Component
-------------

[](#vue-component)

A vue component is provided along with this package which can be used as an interactive input field for uploading large files. The component is provided in two presets, one for Bootstrap and the other for UIKit. The bootstrap version requires jQuery to work while the UIKit version requires the uikit library. However, these are entirely non-compulsory. To use the component, publish the resources by running:

```
php artisan wormhole:publish uikit // or, bootstrap
```

`FileUploader.vue` file will be placed at `resources/js/components` directory of your Laravel application. You have to import the component to your `app.js` file. Afterward, you can use it in blade files or other vue components,

```

```

The Vue component has seven props and among them only one is mandatory to specify.

ParameterTypeRequiredDefaultDescription`url`stringYesThe route to send a post request to your app`input-label`stringNoLabel of your input field. It won't be shown unless you set it explicitly.`input-placeholder`stringNo'Choose file'Placeholder which will be shown upon file input element.`supported-formats`arrayNonullDefines which type of files are supported. If you set supported formats, the file format will be validated during selection. Also a helper text related to supported formats will be shown under the input element.`max-size`integerNonullMaximum size of selected file in megabyte. If you set the max size property, file size will be validated during selection. Also a helper text related to size will be shown under the input element.`field-name`stringNo'file'Once the file is uploaded, a hidden input element will hold the returned name of the file as value so that you can save it in database. This property defines the name of that input element.`wait`integerNo5Defines how long the uploader should wait before starting the upload. This waiting time gives user an opportunity to abort the upload and reselect the file.`notification-position`stringNo'top-right'**Only applicable for UIKit component**. Defines the position of the notification pop-up. See available options [here](https://getuikit.com/docs/notification#position).### Samples

[](#samples)

#### UIKit Component

[](#uikit-component)

[![](assets/sample-upload-uikit.gif)](assets/sample-upload-uikit.gif)

#### Bootstrap Component

[](#bootstrap-component)

[![](assets/sample-upload-bootstrap.gif)](assets/sample-upload-bootstrap.gif)

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 96.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~27 days

Recently: every ~43 days

Total

9

Last Release

1912d ago

Major Versions

v1.x-dev → v2.0.02020-08-13

### Community

Maintainers

![](https://www.gravatar.com/avatar/d68d6a94f8d5ad13f4ceaafa97883eb987bb0b6d828c06bcf53ca8c95f8e8d0f?d=identicon)[sowrensen](/maintainers/sowrensen)

---

Top Contributors

[![sowrensen](https://avatars.githubusercontent.com/u/13097375?v=4)](https://github.com/sowrensen "sowrensen (26 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

laravelstoragefile-uploaderbase64-file

### Embed Badge

![Health badge](/badges/sowrensen-wormhole/health.svg)

```
[![Health](https://phpackages.com/badges/sowrensen-wormhole/health.svg)](https://phpackages.com/packages/sowrensen-wormhole)
```

###  Alternatives

[zgldh/laravel-upload-manager

Upload, validate, storage, manage by API for Laravel 5/6/7/8/9

795.5k2](/packages/zgldh-laravel-upload-manager)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
