1 | <?php namespace Modules\Media\Entities; |
||
13 | class File extends Model |
||
14 | { |
||
15 | use Translatable; |
||
16 | /** |
||
17 | * All the different images types where thumbnails should be created |
||
18 | * @var array |
||
19 | */ |
||
20 | private $imageExtensions = ['jpg', 'png', 'jpeg', 'gif']; |
||
21 | |||
22 | protected $table = 'media__files'; |
||
23 | public $translatedAttributes = ['description', 'alt_attribute', 'keywords']; |
||
24 | protected $fillable = [ |
||
25 | 'description', |
||
26 | 'alt_attribute', |
||
27 | 'keywords', |
||
28 | 'filename', |
||
29 | 'path', |
||
30 | 'extension', |
||
31 | 'mimetype', |
||
32 | 'width', |
||
33 | 'height', |
||
34 | 'filesize', |
||
35 | 'folder_id', |
||
36 | ]; |
||
37 | protected $appends = ['path_string']; |
||
38 | |||
39 | public function getPathAttribute($value) |
||
43 | |||
44 | public function getPathStringAttribute() |
||
48 | |||
49 | public function isImage() |
||
53 | |||
54 | public function getThumbnail($type) |
||
62 | } |
||
63 |