PHPackages                             hlacos/attachment - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. hlacos/attachment

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

hlacos/attachment
=================

Laravel attachment bundle

2491PHP

Since Feb 14Pushed 11y ago1 watchersCompare

[ Source](https://github.com/Hlacos/attachment)[ Packagist](https://packagist.org/packages/hlacos/attachment)[ RSS](/packages/hlacos-attachment/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

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

[](#attachment-bundle)

Eloquent extension for store simply file attachments.

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

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

[](#installation)

1. add bundle to composer: "hlacos/attachment": "dev-master"
2. composer install
3. add service provider to the providers list: 'Hlacos\\Attachment\\AttachmentServiceProvider'
4. php artisan migrate --package="hlacos/attachment"
5. create directory: public/attachments
6. let it write by the web server

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

1. php artisan config:publish hlacos/attachment
2. edit app/config/packages/hlacos/attachment.php

Usage
=====

[](#usage)

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

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

[](#override-table)

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

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

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

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

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

[](#related-models)

You can set polymoprhic relations in the realted models.

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

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

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

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/5fc02ed73047a5c4baec884c0a87d6f9f50c3cfa9d1d4c8b2718034d75c7e6a4?d=identicon)[Hlacos](/maintainers/Hlacos)

### Embed Badge

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

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

###  Alternatives

[inc2734/wp-breadcrumbs

A library for WordPress breadcrumbs.

1543.1k1](/packages/inc2734-wp-breadcrumbs)

PHPackages © 2026

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