Better attachment handling.

This commit is contained in:
James Cole 2015-07-25 18:33:19 +02:00
parent 7ab0508167
commit 92799699bc
2 changed files with 9 additions and 3 deletions

View File

@ -60,10 +60,14 @@ class AttachmentHelper implements AttachmentHelperInterface
{
$files = Input::file('attachments');
foreach ($files as $entry) {
if (!is_null($entry)) {
$this->processFile($entry, $model);
if (is_array($files)) {
foreach ($files as $entry) {
if (!is_null($entry)) {
$this->processFile($entry, $model);
}
}
} else {
$this->processFile($files, $model);
}
return true;

View File

@ -119,6 +119,8 @@ class AttachmentController extends Controller
/**
* @param Attachment $attachment
*
* @return \Illuminate\Http\Response
*/
public function preview(Attachment $attachment)
{