PHPackages                             sehrgut/laravel-attachments - 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. [Database &amp; ORM](/categories/database)
4. /
5. sehrgut/laravel-attachments

AbandonedArchivedLibrary[Database &amp; ORM](/categories/database)

sehrgut/laravel-attachments
===========================

Traits which make attaching files to your Eloquent models super easy!

22.7k[2 issues](https://github.com/sehrgutesoftware/laravel-attachments/issues)PHP

Since Jun 14Pushed 8y ago1 watchersCompare

[ Source](https://github.com/sehrgutesoftware/laravel-attachments)[ Packagist](https://packagist.org/packages/sehrgut/laravel-attachments)[ RSS](/packages/sehrgut-laravel-attachments/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel Attachments
===================

[](#laravel-attachments)

Create attachment database column
---------------------------------

[](#create-attachment-database-column)

Create a database field (nullable string) for every attachment of a model, e.g.:

```
$table->string('profile_image')->nullable();
```

Define the attachments in your model like this:
-----------------------------------------------

[](#define-the-attachments-in-your-model-like-this)

```
protected $image_attachments = [
	'profile_image' => [
	    'path' => 'uploads/user/avatar',
	    'defaults' => [
	        'small' => '.jpg',
	        'medium' => '.jpg',
	        'large' => '.jpg',
	    ],
	    'styles' => [
	        'small' => '100',
	        'medium' => '500',
	        'large' => '1000'
	    ]
	],
	'background_image' => [
	    'path' => 'uploads/user/background',
	    'defaults' => [
	        'small' => '.jpg',
	        'medium' => '.jpg',
	        'large' => '.jpg',
	    ],
	    'styles' => [
	        'small' => '100',
	        'medium' => '500',
	        'large' => '1000'
	    ]
	]
];
```

Using it
--------

[](#using-it)

As simple as:

```
$me->updateImageAttachment('profile_image', $request->fileContent(), $request->fileType());
```

###  Health Score

19

—

LowBetter than 9% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7778513?v=4)[Mohan Klein](/maintainers/mohanklein)[@mohanklein](https://github.com/mohanklein)

---

Top Contributors

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

---

Tags

eloquentfile-uploadimage-processingimage-uploadlaravelphp

### Embed Badge

![Health badge](/badges/sehrgut-laravel-attachments/health.svg)

```
[![Health](https://phpackages.com/badges/sehrgut-laravel-attachments/health.svg)](https://phpackages.com/packages/sehrgut-laravel-attachments)
```

###  Alternatives

[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k116.5M113](/packages/jdorn-sql-formatter)[propel/propel1

Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

8351.6M87](/packages/propel-propel1)[jfelder/oracledb

Oracle DB driver for Laravel

11518.4k](/packages/jfelder-oracledb)

PHPackages © 2026

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