PHPackages                             hlacos/attachment5 - 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. hlacos/attachment5

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

hlacos/attachment5
==================

Attachment bundle for laravel 5.1

0.1.5(7y ago)14.1k21PHPPHP &gt;=5.5.9

Since Aug 26Pushed 6y ago1 watchersCompare

[ Source](https://github.com/Hlacos/Attachment5)[ Packagist](https://packagist.org/packages/hlacos/attachment5)[ RSS](/packages/hlacos-attachment5/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (1)Dependencies (1)Versions (6)Used By (1)

Attachment bundle
=================

[](#attachment-bundle)

Laravel 5 bundle for store simply file attachments.

It's under development, not recommended for production use!

Installation
============

[](#installation)

1. add bundle to composer: "hlacos/attachment5": "dev-master"
2. composer install / update
3. add service provider to the providers list: 'Hlacos\\Attachment5\\Attachment5ServiceProvider'
4. publish config and migration: php artisan vendor:publish --provider="Hlacos\\Attachment5\\Attachment5ServiceProvider"
5. php artisan migrate
6. create directory: public/attachments
7. let it write by the web server

Attachments storing in public/attachments directory. To override it:

2. edit config/attachment5.php

Usage
=====

[](#usage)

```
$attachment = new Attachment;
$attachment->addFile($filename);
$attachment->attachable()->associate($relatedModel);
$attachment->save();
```

Override table
--------------

[](#override-table)

Extend Hlacos\\Attachment5\\Models\\Attachment and set the $table attribute.

Set uploadable image required sizes
-----------------------------------

[](#set-uploadable-image-required-sizes)

Extend Hlacos\\Attachment5\\Models\\Attachment and set the $sizes array attribute. In the array sets the width of the required images;

Set max size of the original image
----------------------------------

[](#set-max-size-of-the-original-image)

Extend Hlacos\\Attachment5\\Models\\Attachment and set the $originalMaxSize string attribute.

Related models
==============

[](#related-models)

You can set polymoprhic relations in the realted models.

```
public function attachment() {
    return $this->morphOne('Hlacos\Attachment5\Models\Attachment', 'attachable');
}
```

```
public function attachment() {
    return $this->morphMany('Hlacos\Attachment5\Models\Attachment', 'attachable');
}
```

Contributions
=============

[](#contributions)

Thanks to David Beyaty () for the gif resize implementation.

###  Health Score

29

—

LowBetter than 58% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 83.3% 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 ~186 days

Total

5

Last Release

2826d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5fc02ed73047a5c4baec884c0a87d6f9f50c3cfa9d1d4c8b2718034d75c7e6a4?d=identicon)[Hlacos](/maintainers/Hlacos)

---

Top Contributors

[![Hlacos](https://avatars.githubusercontent.com/u/1110554?v=4)](https://github.com/Hlacos "Hlacos (5 commits)")[![hatja](https://avatars.githubusercontent.com/u/8983266?v=4)](https://github.com/hatja "hatja (1 commits)")

### Embed Badge

![Health badge](/badges/hlacos-attachment5/health.svg)

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

###  Alternatives

[illuminate/filesystem

The Illuminate Filesystem package.

15163.8M3.0k](/packages/illuminate-filesystem)[spatie/laravel-backup-server

Backup multiple applications

17119.3k1](/packages/spatie-laravel-backup-server)

PHPackages © 2026

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