PHPackages                             svenk/laravel-base64-images - 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. svenk/laravel-base64-images

ActiveLibrary

svenk/laravel-base64-images
===========================

Simply store base64 images in laravel

01PHP

Since Jul 27Pushed 1y ago1 watchersCompare

[ Source](https://github.com/svenk2002/LaravelBase64Images)[ Packagist](https://packagist.org/packages/svenk/laravel-base64-images)[ RSS](/packages/svenk-laravel-base64-images/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel Base64 Images
=====================

[](#laravel-base64-images)

Simply store and delete base64 images in Laravel.

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

[](#installation)

1. **Install the package via Composer:**

    ```
    composer require svenk/laravel-base64-images
    ```
2. **Publish the configuration file:**

    ```
    php artisan vendor:publish --tag=config
    ```
3. **Add the service provider and alias (if not using package auto-discovery):**

    Open `config/app.php` and add the following to the `providers` array:

    ```
    SvenK\LaravelBase64Images\Base64ImagesServiceProvider::class,
    ```

    Add the following to the `aliases` array:

    ```
    'Base64ImageHelper' => SvenK\LaravelBase64Images\Facades\Base64ImageHelper::class,
    ```

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

[](#configuration)

The configuration file `config/base64images.php` will be published to your application. You can customize the following settings:

```
return [
    'scaling' => env('BASE64IMAGES_SCALING', null),
    'quality' => env('BASE64IMAGES_QUALITY', 80),
];
```

- `scaling`: The scaling factor for the images.
- `quality`: The quality of the webp images (0-100).

Usage
-----

[](#usage)

### Storing an Image

[](#storing-an-image)

To store a base64 encoded image:

```
use SvenK\LaravelBase64Images\Facades\Base64ImageHelper;

$base64Image = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...'; // Your base64 encoded image string
$path = 'images'; // The directory where the image will be stored
$storedImagePath = Base64ImageHelper::store($base64Image, $path);

echo $storedImagePath; // Outputs the stored image path
```

### Deleting an Image

[](#deleting-an-image)

To delete an image from storage:

```
use SvenK\LaravelBase64Images\Facades\Base64ImageHelper;

$imagePath = '/storage/images/your-image.webp';
$isDeleted = Base64ImageHelper::delete($imagePath);

if ($isDeleted) {
    echo 'Image deleted successfully.';
} else {
    echo 'Failed to delete image.';
}
```

What It Does
------------

[](#what-it-does)

This package provides a helper class to easily store and delete base64 encoded images in Laravel.

- **Store**: Converts a base64 encoded image to a webp format and saves it to the specified directory. The stored image path is returned.
- **Delete**: Deletes an image from the specified path.

The helper class utilizes the Intervention Image package for image processing and Laravel's Storage facade for file storage operations.

License
-------

[](#license)

This package is open-source software licensed under the [MIT license](https://opensource.org/licenses/MIT).

Author
------

[](#author)

- svenk2002

###  Health Score

13

—

LowBetter than 1% of packages

Maintenance28

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity17

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/8402fc7daaa550275c8542f919996fd5f61d95770bdb2201f766c8e4e64762af?d=identicon)[svenk2002](/maintainers/svenk2002)

---

Top Contributors

[![svenk2002](https://avatars.githubusercontent.com/u/74619197?v=4)](https://github.com/svenk2002 "svenk2002 (2 commits)")

### Embed Badge

![Health badge](/badges/svenk-laravel-base64-images/health.svg)

```
[![Health](https://phpackages.com/badges/svenk-laravel-base64-images/health.svg)](https://phpackages.com/packages/svenk-laravel-base64-images)
```

PHPackages © 2026

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