-
-
Notifications
You must be signed in to change notification settings - Fork 22
/
nova-media-hub.php
122 lines (97 loc) · 4.01 KB
/
nova-media-hub.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<?php
use Spatie\Image\Enums\Fit;
return [
// Table name
'table_name' => 'media_hub',
// Base URL path in Nova
'base_path' => 'media-hub',
// Classes configuration
'model' => \Outl1ne\NovaMediaHub\Models\Media::class,
'file_namer' => \Outl1ne\NovaMediaHub\MediaHandler\Support\FileNamer::class,
'file_validator' => \Outl1ne\NovaMediaHub\MediaHandler\Support\FileValidator::class,
'media_manipulator' => \Outl1ne\NovaMediaHub\MediaHandler\Support\MediaManipulator::class,
// This default PathMaker puts files in a /prefix/<mediaid>/* structure
'path_maker' => \Outl1ne\NovaMediaHub\MediaHandler\Support\PathMaker::class,
// If you want files to be in a /prefix/year/month/<mediaid>/* folder structure, use DatePathMaker instead
// 'path_maker' => \Outl1ne\NovaMediaHub\MediaHandler\Support\DatePathMaker::class,
// Disk configurations
'disk_name' => 'public',
'conversions_disk_name' => 'public',
// Path configuration
'path_prefix' => 'media',
// Locales (for translatable alt texts and titles)
// Set to null if you don't want translatability
// Example value: ['et' => 'Estonian', 'en' => 'English']
'locales' => null,
// File size upper limit
'max_uploaded_file_size_in_kb' => 15000,
// Allowed mime types list
'allowed_mime_types' => [
'image/jpeg',
'image/png',
'image/gif',
'image/svg+xml',
'image/webp',
'video/mp4',
'text/csv',
'application/pdf',
],
// Job queue configuration
'original_image_manipulations_job_queue' => null,
'image_conversions_job_queue' => null,
// Default collections that will always be displayed (even when empty)
'collections' => [
'default',
],
// Defines whether user can create collections in the "Upload media" modal
// If set to false, the user can only use the collections defined in the config
'user_can_create_collections' => true,
// Thumbnail conversion name
// If you want Nova to use thumbnails instead of full size files
// when dispalying media, define the name of the conversion here
'thumbnail_conversion_name' => null,
// Image manipulation driver
// If null, it will try to read config('image.driver')
// Final fallback is 'gd'
// Options: null, 'imagick', 'gd'
'image_driver' => null,
// -- Conversions
// 'collection_name' => ['conversion_name' => [options]]
// Use '*' as wildcard for all collections
'image_conversions' => [
'*' => [
// Disable oiriginal image optimizations on a per-collection basis
// Only accepts 'false' as an argument to disable original image manipulations
// 'original' => false,
'thumbnail' => [
// Image format, null for same as original
// Other options: jpg, pjpg, png, gif, webp, avif, tiff
'format' => null,
'width' => 150,
'height' => 150,
'fit' => Fit::Max,
],
],
],
'original_image_manipulations' => [
// Set to false if you don't want the original image to be optimized
// The mime type must still be in the optimizable_mime_types array
// If set to false, will also disable resizing in max_dimensions
'optimize' => true,
// Maximum number of pixels in height or width, will be scaled down to this number
// Set to null if you don't want the original image to be resized
'max_dimensions' => 2000,
],
// ------------------------------
// -- Image optimizations
// ------------------------------
// NB! Must have a matching image_optimizer configured and binary for it to work
'optimizable_mime_types' => [
'image/jpeg',
// 'image/png',
// 'image/gif',
// 'image/tiff',
],
// Use legacy hashing algorithm for duplicate file detection, along with the new one, less prone to collisions
'check_legacy_hashes' => false,
];