Package Data | |
---|---|
Maintainer Username: | hollogram |
Maintainer Contact: | tandrewbennett@hotmail.com (Travis Bennett) |
Package Create Date: | 2017-08-30 |
Package Last Update: | 2018-11-07 |
Home Page: | http://codesleeve.com |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-09-01 03:09:58 |
Package Statistics | |
---|---|
Total Downloads: | 830 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 0 |
Total Watchers: | 2 |
Total Forks: | 1 |
Total Open Issues: | 0 |
Note: If you've previously been using this package, then you've been using it with Laravel. This package is no longer directly coupled to the Laravel framework. As of 1.0.0, Stapler is now framework agnostic. In order to take advantage of the Laravel specific features provided by the previous Beta releases (service providers, IOC container, commands, migration generator, etc) , I've created a separate package specifically for the purpose of using Stapler within Laravel: Laravel-Stapler. If you're using Stapler inside a Laravel application I strongly recommend you use this package (it will save you a bit of boilerplate).
Stapler is a php-based framework agnostic file upload package inspired by the Ruby Paperclip gem. It can be used to add file file uploads (as attachment objects) to your ORM records. While not an exact duplicate, if you've used Paperclip before then you should feel quite comfortable using this package.
Stapler was created by Travis Bennett.
Stapler currently requires php >= 5.4 (Stapler is implemented via the use of traits).
Stapler is distributed as a composer package, which is how it should be used in your app.
Install the package using Composer. Edit your project's composer.json
file to require codesleeve/stapler
.
"require": {
"codesleeve/stapler": "1.0.*"
}
Stapler works by attaching file uploads to database table records. This is done by defining attachments inside the table's corresponding model and then assigning uploaded files (from your forms) as properties (named after the attachments) on the model before saving it. Stapler will listen to the life cycle callbacks of the model (after save, before delete, and after delete) and handle the file accordingly. In essence, this allows uploaded files to be treated just like any other property on the model; stapler will abstract away all of the file processing, storage, etc so you can focus on the rest of your project without having to worry about where your files are at or how to retrieve them.