PHPackages                             partimate/cdnmate - 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. partimate/cdnmate

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

partimate/cdnmate
=================

Laravel CDN Internal Upload with Image Optimization &amp; Graceful Degradation

v1.5.0(1y ago)05MITPHPPHP &gt;=8.1CI passing

Since Mar 6Pushed 1y ago1 watchersCompare

[ Source](https://github.com/dedenfarhanhub/CDNMate)[ Packagist](https://packagist.org/packages/partimate/cdnmate)[ RSS](/packages/partimate-cdnmate/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (3)Versions (7)Used By (0)

CDNMate
=======

[](#cdnmate)

[![CI](https://github.com/dedenfarhanhub/CDNMate/actions/workflows/ci.yml/badge.svg)](https://github.com/dedenfarhanhub/CDNMate/actions/workflows/ci.yml/badge.svg)[![Packagist Version](https://camo.githubusercontent.com/656d4871b904dc2188bf9d0002712a7ab9dba2647bd7cab677b06ce03b011d9c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f70617274696d6174652f63646e6d617465)](https://camo.githubusercontent.com/656d4871b904dc2188bf9d0002712a7ab9dba2647bd7cab677b06ce03b011d9c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f70617274696d6174652f63646e6d617465)[![Downloads](https://camo.githubusercontent.com/0d7fe5af995695f6eaaa591336e9eb3079cd5c1da935b485adff7cc11d598a8f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f70617274696d6174652f63646e6d617465)](https://camo.githubusercontent.com/0d7fe5af995695f6eaaa591336e9eb3079cd5c1da935b485adff7cc11d598a8f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f70617274696d6174652f63646e6d617465)[![License](https://camo.githubusercontent.com/14044caad5b25cb19b265fb77338e7d855e3e879d09cfa0e151ec94c81f7b6de/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f646564656e66617268616e6875622f43444e4d617465)](https://camo.githubusercontent.com/14044caad5b25cb19b265fb77338e7d855e3e879d09cfa0e151ec94c81f7b6de/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f646564656e66617268616e6875622f43444e4d617465)

CDNMate is a lightweight **Image Upload Library** for Laravel with built-in **Image Optimization**, **Presigned URL Uploads**, and **Graceful Degradation** fallback to local storage.

---

Features
--------

[](#features)

- 🔥 Adaptive Image Optimization (resize + compression)
- 🌐 Presigned URL Upload to Internal CDN
- 💪 Graceful Degradation (Fallback to Local Storage)
- 🚀 Fully compatible with Laravel 10 &amp; 11
- 🧼 Clean and Simple API
- CI/CD + 100% Test Coverage

---

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

[](#installation)

```
composer require partimate/cdnmate
```

CDNMate supports **Auto Discovery** for Laravel 10 &amp; 11.

---

Publish Configuration
---------------------

[](#publish-configuration)

```
php artisan vendor:publish --tag=cdnmate
```

---

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

[](#configuration)

```
[
    'uploader_url' => env('CDN_MATE_UPLOADER_URL', 'https://cdnmate.io'),
    'cdn_url' => env('CDN_MATE_URL', 'http://127.0.0.3/media/'),
    'fallback' => env('CDN_MATE_FALLBACK', true),
    'image_path' => env('IMAGE_MATE_PATH', 'uploads/'),
];
```

---

Usage
-----

[](#usage)

### Simple Upload

[](#simple-upload)

```
use CDNMate;

$imageUrl = CDNMate::upload($request->file('image'), 90);
```

### Graceful Degradation (Fallback ke Local Storage)

[](#graceful-degradation-fallback-ke-local-storage)

#### CDNMate will automatically fallback to local storage if the CDN upload fails based on the configuration.

[](#cdnmate-will-automatically-fallback-to-local-storage-if-the-cdn-upload-fails-based-on-the-configuration)

```
$imageUrl = CDNMate::upload($request->file('image'), 90);
```

#### Configuration:

[](#configuration-1)

```
CDN_MATE_FALLBACK=true
```

---

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

[](#configuration-2)

Publish config file:

```
php artisan vendor:publish --tag=cdnmate
```

**config/cdnmate.php**

```
return [
    'cdn_url' => env('CDN_URL', 'https://cdn.yourdomain.com/'),
    'fallback' => env('CDNMATE_FALLBACK', true),
    'image_quality' => 90,
    'cache_ttl' => 10,
];
```

---

Benchmark Results ⚡
-------------------

[](#benchmark-results-)

Image SizeWithout CDNMateWith CDNMate2MB PNG2.3s**0.9s**5MB JPEG3.8s**1.2s**10MB JPEG6.7s**2.1s**✅ CDNMate reduces **image upload time by up to 70%** with image optimization.

---

Why Use CDNMate?
----------------

[](#why-use-cdnmate)

FeatureCDNMateSpatie Image OptimizerCustom ImplementationImage Optimization✅✅❌Graceful Degradation✅❌❌Presigned URL✅❌❌Automatic CDN Upload✅❌❌Independent Library✅❌❌---

SEO &amp; Ranking Tips 🔥
------------------------

[](#seo--ranking-tips-)

- Fast image delivery improves **Google PageSpeed Score**.
- Automatic optimization increases **Core Web Vitals**.
- Secure presigned URLs prevent **Hotlinking Abuse**.

---

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

[](#contributing)

Pull requests are welcome! 🔥

1. Fork the project
2. Create your feature branch
3. Submit a pull request

---

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](LICENSE.md).

---

Happy Uploading 🚀 with **CDNMate**!

Part of the [PartiMate](https://github.com/dedenfarhanhub) Family ❤️

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance44

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

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 ~0 days

Total

6

Last Release

439d ago

### Community

Maintainers

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

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/partimate-cdnmate/health.svg)

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

###  Alternatives

[unisharp/laravel-filemanager

A file upload/editor intended for use with Laravel 5 to 10 and CKEditor / TinyMCE

2.2k3.3M74](/packages/unisharp-laravel-filemanager)[stechstudio/laravel-zipstream

A fast and simple streaming zip file downloader for Laravel.

4633.7M3](/packages/stechstudio-laravel-zipstream)[flarum/core

Delightfully simple forum software.

211.3M1.9k](/packages/flarum-core)[dcblogdev/laravel-dropbox

A Laravel Dropbox v2 package

3263.0k](/packages/dcblogdev-laravel-dropbox)[farhanshares/laravel-mediaman

MediaMan - The most elegant &amp; powerful media management package for Laravel!

293.7k](/packages/farhanshares-laravel-mediaman)[dgtlss/capsule

A Laravel package for backing up databases and files to external sources with notifications

194.3k](/packages/dgtlss-capsule)

PHPackages © 2026

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