PHPackages                             3xw/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. 3xw/attachment

Abandoned → [3xw/cakephp-attachment](/?search=3xw%2Fcakephp-attachment)Cakephp-plugin[Utility &amp; Helpers](/categories/utility)

3xw/attachment
==============

Attachment plugin for CakePHP

5.0(3y ago)11.2k↓66.7%[2 issues](https://github.com/3xw/attachment/issues)[1 PRs](https://github.com/3xw/attachment/pulls)2PHPPHP &gt;=7.2CI failing

Since Jul 21Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/3xw/attachment)[ Packagist](https://packagist.org/packages/3xw/attachment)[ RSS](/packages/3xw-attachment/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (10)Dependencies (9)Versions (195)Used By (2)

this project as moved!
======================

[](#this-project-as-moved)

Please use [3xw/cakephp-attachment](https://github.com/3xw/cakephp-attachment) instead!!

Attachment plugin for CakePHP ^3.7
==================================

[](#attachment-plugin-for-cakephp-37)

Attachment plugin solves common problems with media, files and embed data. The goal is to store files where you want ( Dropbox, AWS S3, ... ) and keep a record of it in a table.

Attachment offers both storage layer and database layer as well as frontend and backend solutions for common needs.

It uses [CakePHP 3](https://cakephp.org/), [Flysystem](https://flysystem.thephpleague.com/) and [Intervention Image](http://image.intervention.io/)

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

[](#installation)

### Installation.composer

[](#installationcomposer)

You can install this plugin into your CakePHP application using [composer](http://getcomposer.org).

The recommended way to install composer packages is:

```
composer require 3xw/attachment
```

### Installation.load

[](#installationload)

In src/Application.php

```
$this->addPlugin(\ Attachment\Plugin::class, ['bootstrap' => true, 'routes' => true]);
```

Alternatively you can overload with your own settings (config/attachment.php):

```
Configure::write('Attachment.config', ['attachment']);
$this->addPlugin(\ Attachment\Plugin::class, ['bootstrap' => true, 'routes' => true]);
```

### Installation.db

[](#installationdb)

```
bin/cake Migrations migrate -p Attachment
```

a sql file can found at path:

```
vendor/3xw/attachment/config/Schema/attachment.sql
```

### Installation.folders

[](#installationfolders)

Create a thumbnails folder with appropriate chmod to enable php to write in it...

```
mkdir webroot/thumbnails
chmod 777 webroot/thumbnails
```

If you store your files locally, then create a folder according to default settings or your own. For default set as follow:

```
mkdir webroot/files
chmod 777 webroot/files
```

BackendDependencies
-------------------

[](#backenddependencies)

### BackendDependencies.libs

[](#backenddependencieslibs)

In order to use backend tools you need to have following libs installed:

javascript:

```
jquery >= 1.x
vuejs = 2.x
vue-resource = 1.x
```

css:

```
bootstrap = 4.x
```

### BackendDependencies.html

[](#backenddependencieshtml)

Vuejs components are nested to a top parent you need to setup. It requires one extra block (template). Following is easy to achieve.

in your layout.ctp:

```

	...
