1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 16:31:33 +02:00
invoiceninja/app/Models/Document.php
2019-04-28 22:23:22 +10:00

75 lines
1.6 KiB
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Document extends BaseModel
{
const DOCUMENT_PREVIEW_SIZE = 300; // pixels
/**
* @var array
*/
protected $fillable = [
'is_default',
];
/**
* @var array
*/
public static $types = [
'png' => [
'mime' => 'image/png',
],
'ai' => [
'mime' => 'application/postscript',
],
'svg' => [
'mime' => 'image/svg+xml',
],
'jpeg' => [
'mime' => 'image/jpeg',
],
'tiff' => [
'mime' => 'image/tiff',
],
'pdf' => [
'mime' => 'application/pdf',
],
'gif' => [
'mime' => 'image/gif',
],
'psd' => [
'mime' => 'image/vnd.adobe.photoshop',
],
'txt' => [
'mime' => 'text/plain',
],
'doc' => [
'mime' => 'application/msword',
],
'xls' => [
'mime' => 'application/vnd.ms-excel',
],
'ppt' => [
'mime' => 'application/vnd.ms-powerpoint',
],
'xlsx' => [
'mime' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
],
'docx' => [
'mime' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
],
'pptx' => [
'mime' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
],
];
public function documentable()
{
return $this->morphTo();
}
}