Hlacos / Attachment5 by Hlacos

Attachment bundle for laravel 5.1
4,128
1
2
Package Data
Maintainer Username: Hlacos
Maintainer Contact: heiszmann@gmail.com (Heiszmann László)
Package Create Date: 2015-04-03
Package Last Update: 2019-09-16
Language: PHP
License: Unknown
Last Refreshed: 2024-04-25 15:10:26
Package Statistics
Total Downloads: 4,128
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 1
Total Watchers: 2
Total Forks: 2
Total Open Issues: 0

Attachment bundle

Laravel 5 bundle for store simply file attachments.

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

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:

  1. edit config/attachment5.php

Usage

Override table

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

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

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

Related models

You can set polymoprhic relations in the realted models.

Contributions

Thanks to David Beyaty (https://github.com/hatja) for the gif resize implementation.