PHPackages                             mehdismekouar/laravel-glide-helper - 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. [Image &amp; Media](/categories/media)
4. /
5. mehdismekouar/laravel-glide-helper

ActiveLibrary[Image &amp; Media](/categories/media)

mehdismekouar/laravel-glide-helper
==================================

A Laravel helper for image manipulation using Spatie Glide

v1.0.0(7mo ago)286MITPHPPHP ^8.1

Since Oct 20Pushed 5mo agoCompare

[ Source](https://github.com/mehdismekouar/laravel-glide-helper)[ Packagist](https://packagist.org/packages/mehdismekouar/laravel-glide-helper)[ Docs](https://github.com/mehdismekouar/laravel-glide-helper)[ GitHub Sponsors](https://github.com/mehdismekouar)[ RSS](/packages/mehdismekouar-laravel-glide-helper/feed)WikiDiscussions master Synced 1mo ago

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

Laravel Glide Helper
====================

[](#laravel-glide-helper)

[![Latest Version on Packagist](https://camo.githubusercontent.com/080170d7adca37d719a330781a71b17750001cb32b35d41b5cca29b15eb8c4fb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d65686469736d656b6f7561722f6c61726176656c2d676c6964652d68656c7065722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mehdismekouar/laravel-glide-helper)[![Total Downloads](https://camo.githubusercontent.com/8e332131d21ac9e56c631ed3e9473065088099cab1ae328e1dd61f6ecb6dbc0b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d65686469736d656b6f7561722f6c61726176656c2d676c6964652d68656c7065722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mehdismekouar/laravel-glide-helper)

A simple Laravel helper function for on-the-fly image manipulation using Spatie Glide.

Features
--------

[](#features)

- 🚀 **On-the-fly image manipulation** - Resize, crop, and transform images dynamically
- 💾 **Automatic caching** - Generated images are cached to avoid regeneration
- 🔧 **Configurable defaults** - Set global parameters for consistent image processing
- 📁 **Multiple source support** - Works with storage/ and public/ directories
- 🌐 **External URL handling** - Passes through external URLs unchanged
- ⚡ **Performance optimized** - Only processes when necessary

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

[](#installation)

Install the package via Composer:

```
composer require mehdismekouar/laravel-glide-helper
```

Optionally, publish the config file:

```
php artisan vendor:publish --tag="laravel-glide-helper-config"
```

This is the contents of the published config file:

```
return [
    'defaults' => [
        'q' => 90,          // Quality (1-100)
        'fm' => 'webp',     // Format (webp, jpg, png, gif)
        'fit' => 'max'      // Fit (contain, max, fill, stretch, crop)
    ],
    'output_dir' => 'manipulated', // Directory for cached images
];
```

Usage
-----

[](#usage)

### Basic Usage

[](#basic-usage)

```
// In Blade templates

```

### Common Parameters

[](#common-parameters)

```
// Resize
glide($image, ['w' => 300, 'h' => 200])

// Crop to exact dimensions
glide($image, ['w' => 200, 'h' => 200, 'fit' => 'crop'])

// Change format and quality
glide($image, ['fm' => 'webp', 'q' => 85])

// Apply filters
glide($image, ['filt' => 'greyscale', 'blur' => 5])
```

### Supported Parameters

[](#supported-parameters)

All [Glide parameters](https://glide.thephpleague.com/2.0/api/quick-reference/) are supported:

- **Size**: `w` (width), `h` (height), `fit` (contain, max, fill, stretch, crop)
- **Format**: `fm` (webp, jpg, png, gif), `q` (quality 1-100)
- **Effects**: `blur`, `sharp`, `filt` (greyscale)

How It Works
------------

[](#how-it-works)

1. **Path Resolution**: Automatically detects if image is in `storage/` or `public/`
2. **Caching**: Creates a unique hash based on source file and parameters
3. **Generation**: Uses Spatie Glide to manipulate image only if not cached
4. **URL Generation**: Returns asset URL for the manipulated image

External URLs are passed through unchanged.

Requirements
------------

[](#requirements)

- PHP 8.1+
- Laravel 10+
- `spatie/laravel-glide` package (automatically installed)

Credits
-------

[](#credits)

- [Mehdi Mekouar](https://github.com/mehdismekouar)
- Built on top of [Spatie Laravel Glide](https://github.com/spatie/laravel-glide)

License
-------

[](#license)

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

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance67

Regular maintenance activity

Popularity14

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity44

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

Unknown

Total

1

Last Release

211d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/159698492?v=4)[mehdismekouar](/maintainers/mehdismekouar)[@mehdismekouar](https://github.com/mehdismekouar)

---

Top Contributors

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

---

Tags

laravelmehdismekouarlaravel-glide-helper

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mehdismekouar-laravel-glide-helper/health.svg)

```
[![Health](https://phpackages.com/badges/mehdismekouar-laravel-glide-helper/health.svg)](https://phpackages.com/packages/mehdismekouar-laravel-glide-helper)
```

###  Alternatives

[creativeorange/gravatar

A Laravel Gravatar package for retrieving gravatar image URLs or checking the existance of an image.

5467.5M54](/packages/creativeorange-gravatar)[intervention/image-laravel

Laravel Integration of Intervention Image

1536.5M102](/packages/intervention-image-laravel)[bkwld/croppa

Image thumbnail creation through specially formatted URLs for Laravel

510496.0k23](/packages/bkwld-croppa)[ralphjsmit/laravel-glide

Auto-magically generate responsive images from static image files.

4719.6k5](/packages/ralphjsmit-laravel-glide)[spatie/laravel-og-image

Generate OG images for your Laravel app

305.2k](/packages/spatie-laravel-og-image)[nikkanetiya/laravel-color-palette

Laravel Wrapper for `ksubileau/color-thief-php`. Grabs the dominant color or a representative color palette from an image. Uses PHP and GD or Imagick.

3312.6k](/packages/nikkanetiya-laravel-color-palette)

PHPackages © 2026

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