PHPackages                             3xw/cakephp-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. [Framework](/categories/framework)
4. /
5. 3xw/cakephp-attachment

ActiveCakephp-plugin[Framework](/categories/framework)

3xw/cakephp-attachment
======================

New Attachment plugin for CakePHP

5.3.7(3mo ago)3426[3 issues](https://github.com/3xw/cakephp-attachment/issues)3PHPPHP &gt;=8.1

Since Nov 11Pushed 3mo ago1 watchersCompare

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

READMEChangelog (10)Dependencies (9)Versions (54)Used By (3)

Attachment plugin for CakePHP 5.x
=================================

[](#attachment-plugin-for-cakephp-5x)

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

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

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

Requirements
------------

[](#requirements)

- PHP &gt;= 8.1
- CakePHP ^5.0
- friendsofcake/crud ^7.0
- friendsofcake/search ^7.0
- firebase/php-jwt ^7.0

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/cakephp-attachment
```

### Installation.load

[](#installationload)

In src/Application.php

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

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

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

### Installation.db

[](#installationdb)

```
bin/cake migrations migrate -p Trois/Attachment
```

A SQL file can be found at:

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

### Installation.folders

[](#installationfolders)

Create a thumbnails folder with appropriate permissions:

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

If you store your files locally, create a folder according to default settings or your own:

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

Backend Dependencies
--------------------

[](#backend-dependencies)

### 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)

Vue.js 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.php:

```

    ...
