PHPackages                             keltron/filehelper - 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. keltron/filehelper

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

keltron/filehelper
==================

Filehelper for Keltron inhouse projects

v2.1.0(3y ago)32.7k↑50%MITPHPPHP &gt;=7.2

Since Oct 5Pushed 3y ago1 watchersCompare

[ Source](https://github.com/hareendranmg/filehelper)[ Packagist](https://packagist.org/packages/keltron/filehelper)[ Docs](https://github.com/hareendranmg/filehelper)[ RSS](/packages/keltron-filehelper/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (10)DependenciesVersions (13)Used By (0)

Filehelper
==========

[](#filehelper)

[![Total Downloads](https://camo.githubusercontent.com/bc7aac4bb7982829314d58967e288032d60bdf758d45fae0511ad0e849ed8509/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b656c74726f6e2f66696c6568656c706572)](https://packagist.org/packages/keltron/filehelper)[![Latest Stable Version](https://camo.githubusercontent.com/bc858d05c41e73e85942b7190fa25ae24a242f32224bdf52711fc909182e002d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b656c74726f6e2f66696c6568656c706572)](https://packagist.org/packages/keltron/filehelper)[![License](https://camo.githubusercontent.com/bdc855673bffbf71613883506d643be2655550f92d5e28b99445046da74a4c45/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6b656c74726f6e2f66696c6568656c706572)](https://packagist.org/packages/keltron/filehelper)

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

[](#installation)

Via Composer

```
composer require keltron/filehelper
```

```
php artisan vendor:publish --tag=filehelper.config
```

```
php artisan vendor:publish --provider="Keltron\Filehelper\FilehelperServiceProvider"
```

```
php artisan vendor:publish --provider="Keltron\Filehelper\FilehelperServiceProvider" --tag="migrations"
```

```
php artisan migrate --path=database/migrations/2021_09_13_055730_create_filehelper_table.php
```

Files Dashboard
---------------

[](#files-dashboard)

View Files and folders in the project by going to the following route

```
files/file_helper_dashboard
```

Login credentials (username/password) are required to access the files dashboard.

These can be set in the filehelper.php config file.

Default credentials are fh\_admin/fh\_admin@246

Be sure to change these credentials before deploying the application.

Usage
-----

[](#usage)

### Keltron\\Filehelper\\Filehelper::putFile

[](#keltronfilehelperfilehelperputfile)

#### Insert a file into the storage.

[](#insert-a-file-into-the-storage)

```
public static function putFile(
    $folder,
    $file,
    $file_name = '',
    $file_types = ['image', 'pdf', 'doc'],
    $max_file_size = 0
) { }
```

```
@param string $folder
The folder to store the file. If the folder does not exist, it will be created.

@param \Illuminate\Http\File|\Illuminate\Http\UploadedFile|string $file
The file to store. If the file is a string, it will be converted to a file.

@param string $file_name
(optional) The name of the file. If the file name is not provided, the file name will be the original file name.

@param array $file_types
(optional) File types to be accepted. If not provided, image, pdf and doc files will be accepted. Example: ['image', 'pdf']. Default: ['image', 'pdf', 'doc']

@param array $max_file_size
(optional) File size to be accepted. If not provided, max_file_size parameter in filehelper config file will be used.

@return array
The file information.['status' => true|false, 'message' => '', 'file_name' => '', 'file_path' => '', 'file_url' => '']
```

### Keltron\\Filehelper\\Filehelper::getFile

[](#keltronfilehelperfilehelpergetfile)

#### Get a file from the storage by file id.

[](#get-a-file-from-the-storage-by-file-id)

```
public static function getFile($encrypted_file_id, $get_type = 0) { }
```

```
@param string $encrypted_file_id — The encrypted file id.

@param int $get_type
(optional) If get_type is 0 it will return file response, If get_type is 1 the file is forcefully download. By default get_type is 0

@param string $file_extension
(optional) The file extension. If the file extension is not provided, the file extension will be the original file extension.

@return \Illuminate\Http\Response
```

### Keltron\\Filehelper\\Filehelper::getFileFromPath

[](#keltronfilehelperfilehelpergetfilefrompath)

#### Get a file from the storage by file path.

[](#get-a-file-from-the-storage-by-file-path)

```
public static function getFileFromPath($encrypted_file_path, $get_type = 0) { }
```

```
@param string $encrypted_file_path — The encrypted file path.

@param int $get_type
(optional) If get_type is 0 it will return file response, If get_type is 1 the file is forcefully download. By default get_type is 0

@return \Illuminate\Http\Response
```

### Keltron\\Filehelper\\Filehelper::getFileTypeImageFromId

[](#keltronfilehelperfilehelpergetfiletypeimagefromid)

#### Get a file type icon image from the file id.

[](#get-a-file-type-icon-image-from-the-file-id)

```
public static function getFileTypeImageFromId($encryptedFileId) { }
```

```
@param string $encryptedFileId — The encrypted file id.

@return \Illuminate\Http\Response
```

### Keltron\\Filehelper\\Filehelper::getFileTypeImageFromPath

[](#keltronfilehelperfilehelpergetfiletypeimagefrompath)

#### Get a file type icon image from the file path.

[](#get-a-file-type-icon-image-from-the-file-path)

```
public static function getFileTypeImageFromPath($encryptedFilePath) { }
```

```
@param string $encryptedFilePath — The encrypted file path.

@return \Illuminate\Http\Response
```

### Keltron\\Filehelper\\Filehelper::getFileUrl

[](#keltronfilehelperfilehelpergetfileurl)

#### Get file url from encrypted file id.

[](#get-file-url-from-encrypted-file-id)

```
public static function getFileUrl($encrypted_file_path) { }
```

```
@param string $encrypted_file_id The encrypted file id.

@return string The file url.
```

### Keltron\\Filehelper\\Filehelper::getFileInfo

[](#keltronfilehelperfilehelpergetfileinfo)

#### Get information of the file by file id.

[](#get-information-of-the-file-by-file-id)

```
public static function getFileInfo($encrypted_file_id) { }
```

```
@param string $encrypted_file_id — The encrypted file id.

@return array — [ 'status' => true/false, ]
```

### Keltron\\Filehelper\\Filehelper::getFileBinary

[](#keltronfilehelperfilehelpergetfilebinary)

```
public static function getFileBinary($encrypted_file_id) { }
```

```
@param mixed $encrypted_file_id

@return string
```

### Keltron\\Filehelper\\Filehelper::deleteFile

[](#keltronfilehelperfilehelperdeletefile)

#### Delete the file by file id.

[](#delete-the-file-by-file-id)

```
public static function deleteFile($encrypted_file_id) { }
```

```
@param string $encrypted_file_id — The encrypted file id.

@return array — [ 'status' => true/false, ]
```

Helpers (Can use in blade and use without namespace in controller)
------------------------------------------------------------------

[](#helpers-can-use-in-blade-and-use-without-namespace-in-controller)

### Can call from any blade or any controller

[](#can-call-from-any-blade-or-any-controller)

```
put_file($folder, $file, $file_name = '', $file_types = ['image', 'pdf', 'doc'], $max_file_size = 0)

get_file($encrypted_file_id, $get_type = 0)

get_file_from_path($encrypted_file_path, $get_type = 0)

get_file_type_image_from_id($encrypted_file_path)

get_file_type_image_from_path($encrypted_file_path)

get_file_url($encrypted_file_id)

get_file_info($encrypted_file_id)

get_file_binary($encrypted_file_id)

delete_file($encrypted_file_id)
```

Change log
----------

[](#change-log)

Please see the [changelog](changelog.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [contributing.md](contributing.md) for details and a todolist.

Security
--------

[](#security)

If you discover any security related issues, please email instead of using the issue tracker.

Credits
-------

[](#credits)

- [Hareendran M G](https://hareendran.ml)

License
-------

[](#license)

Please see the [license file](license.md) for more information.

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~31 days

Recently: every ~54 days

Total

12

Last Release

1386d ago

Major Versions

v1.2.0 → v2.0.02022-03-24

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/19310197?v=4)[Hareendran MG](/maintainers/hareendranmg)[@hareendranmg](https://github.com/hareendranmg)

---

Top Contributors

[![hareendranmg](https://avatars.githubusercontent.com/u/19310197?v=4)](https://github.com/hareendranmg "hareendranmg (24 commits)")

---

Tags

filehelperkeltronlaravelpackagephplaravelFilehelper

### Embed Badge

![Health badge](/badges/keltron-filehelper/health.svg)

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

###  Alternatives

[yoelpc4/laravel-cloudinary

Laravel Cloudinary filesystem cloud driver.

3345.6k](/packages/yoelpc4-laravel-cloudinary)[menthe/aliyun-ueditor

UEditor for laravel5 and Aliyun OSS.Store all images and files in Aliyun OSS. Support i18n. UEditor is a Rich Text Web Editor From Baidu.

182.4k](/packages/menthe-aliyun-ueditor)

PHPackages © 2026

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