PHPackages                             awaisjameel/base64filehandler - 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. awaisjameel/base64filehandler

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

awaisjameel/base64filehandler
=============================

A Laravel package for handling and storing base64 encoded files.

1.0.0(1y ago)015[4 PRs](https://github.com/awaisjameel/Base64FileHandler/pulls)MITPHPPHP ^8.2CI passing

Since Feb 28Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/awaisjameel/Base64FileHandler)[ Packagist](https://packagist.org/packages/awaisjameel/base64filehandler)[ Docs](https://github.com/awaisjameel/base64filehandler)[ GitHub Sponsors](https://github.com/AwaisJameel)[ RSS](/packages/awaisjameel-base64filehandler/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (13)Versions (7)Used By (0)

Base64 File Handler
===================

[](#base64-file-handler)

A Laravel package for handling and storing base64 encoded files.

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

[](#installation)

You can install the package via composer:

```
composer require AwaisJameel/base64-file-handler
```

The package will automatically register its service provider if you're using Laravel 5.5+.

You can publish the configuration file with:

```
php artisan vendor:publish --provider="AwaisJameel\Base64FileHandler\Base64FileHandlerServiceProvider" --tag="config"
```

Configuration
-------------

[](#configuration)

After publishing the configuration file, you can find it at `config/base64-file-handler.php`. The configuration allows you to set:

- Default storage disk
- Default storage path
- Allowed file extensions
- Valid image extensions

Usage
-----

[](#usage)

### Basic Usage

[](#basic-usage)

You can use the facade to store base64 encoded files:

```
use AwaisJameel\Base64FileHandler\Facades\Base64FileHandler;

// Store a base64 encoded file
$filePath = Base64FileHandler::store($base64Data);

// Store with custom parameters
$filePath = Base64FileHandler::store(
    $base64Data,
    'local',                   // custom disk
    'custom/path/',            // custom path
    'original-filename.jpg',   // original filename
    ['jpg', 'png']             // allowed extensions
);
```

### Validating Images

[](#validating-images)

```
use AwaisJameel\Base64FileHandler\Facades\Base64FileHandler;

try {
    Base64FileHandler::isValidImage($base64Data);
    // The data is a valid image
} catch (Exception $e) {
    // The data is not a valid image
}
```

### Getting File Information

[](#getting-file-information)

```
use AwaisJameel\Base64FileHandler\Facades\Base64FileHandler;

$fileInfo = Base64FileHandler::getFileInfo($base64Data);
// Returns array with mime, extension, size, and decoded data
```

### Direct Instantiation

[](#direct-instantiation)

You can also use the class directly without the facade:

```
use AwaisJameel\Base64FileHandler\Base64FileHandler;

$handler = new Base64FileHandler([
    'disk' => 'local',
    'path' => 'custom/path/',
    'allowed_extensions' => ['jpg', 'png', 'pdf'],
]);

$filePath = $handler->store($base64Data);
```

Error Handling
--------------

[](#error-handling)

The package throws exceptions when:

- The base64 data is invalid
- The file extension is not allowed
- The image extension is invalid (when validating images)
- Unable to store the file

Wrap your code in try-catch blocks to handle these exceptions.

Testing
-------

[](#testing)

```
composer test
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance71

Regular maintenance activity

Popularity6

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 60% 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

Unknown

Total

1

Last Release

435d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8478f5cd00831255bda5f4ab259a8761a8001142756ab90bf8804388a78b2036?d=identicon)[awaisjameel](/maintainers/awaisjameel)

---

Top Contributors

[![awaisjameel](https://avatars.githubusercontent.com/u/9046343?v=4)](https://github.com/awaisjameel "awaisjameel (9 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (3 commits)")

---

Tags

laravelAwais Jameelbase64filehandler

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/awaisjameel-base64filehandler/health.svg)

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

###  Alternatives

[spatie/livewire-filepond

Upload files using Filepond in Livewire components

306452.7k3](/packages/spatie-livewire-filepond)[elegantly/laravel-invoices

Store invoices safely in your Laravel application

23131.8k](/packages/elegantly-laravel-invoices)[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24149.7k](/packages/vormkracht10-laravel-mails)[mwguerra/filemanager

A full-featured file manager package for Laravel and Filament v5 with dual operating modes, drag-and-drop uploads, S3/MinIO support, and comprehensive security features.

718.5k1](/packages/mwguerra-filemanager)[codebar-ag/laravel-flysystem-cloudinary

Cloudinary Flysystem v1 integration with Laravel

1224.9k2](/packages/codebar-ag-laravel-flysystem-cloudinary)[kalynasolutions/laravel-tus

Laravel package for handling resumable file uploads with tus protocol and native Uppy.js support without additional tus servers

5261.8k1](/packages/kalynasolutions-laravel-tus)

PHPackages © 2026

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