|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Spatie\MediaLibraryPro\Http\Components; |
|
4
|
|
|
|
|
5
|
|
|
use Illuminate\View\Component; |
|
6
|
|
|
use Spatie\MediaLibrary\HasMedia; |
|
|
|
|
|
|
7
|
|
|
use Spatie\MediaLibraryPro\WithAccessingMedia; |
|
8
|
|
|
|
|
9
|
|
|
class MediaLibraryCollectionComponent extends Component |
|
10
|
|
|
{ |
|
11
|
|
|
use WithAccessingMedia; |
|
|
|
|
|
|
12
|
|
|
|
|
13
|
|
|
public string $name; |
|
14
|
|
|
public HasMedia $model; |
|
15
|
|
|
public string $collection; |
|
16
|
|
|
|
|
17
|
|
|
public string $rules; |
|
18
|
|
|
public ?int $maxItems; |
|
19
|
|
|
public bool $sortable; |
|
20
|
|
|
public bool $editableName = true; |
|
21
|
|
|
|
|
22
|
|
|
public array $media; |
|
23
|
|
|
|
|
24
|
|
|
public ?string $componentView; |
|
25
|
|
|
public ?string $listView; |
|
26
|
|
|
public ?string $itemView; |
|
27
|
|
|
public ?string $propertiesView; |
|
28
|
|
|
public ?string $fieldsView; |
|
29
|
|
|
|
|
30
|
|
|
public bool $multiple = true; |
|
31
|
|
|
|
|
32
|
|
|
public function __construct( |
|
33
|
|
|
string $name, |
|
34
|
|
|
HasMedia $model, |
|
35
|
|
|
string $collection = null, |
|
36
|
|
|
string $rules = '', |
|
37
|
|
|
?int $maxItems = null, |
|
38
|
|
|
bool $sortable = true, |
|
39
|
|
|
bool $editableName = true, |
|
40
|
|
|
?string $view = null, |
|
41
|
|
|
?string $listView = null, |
|
42
|
|
|
?string $itemView = null, |
|
43
|
|
|
?string $propertiesView = null, |
|
44
|
|
|
?string $fieldsView = null, |
|
45
|
|
|
bool $multiple = true |
|
46
|
|
|
) { |
|
47
|
|
|
$this->name = $name; |
|
48
|
|
|
$this->model = $model; |
|
49
|
|
|
$this->collection = $collection ?? 'default'; |
|
50
|
|
|
|
|
51
|
|
|
$this->rules = $rules; |
|
52
|
|
|
$this->maxItems = $maxItems; |
|
53
|
|
|
$this->editableName = $editableName; |
|
54
|
|
|
$this->sortable = $sortable; |
|
55
|
|
|
|
|
56
|
|
|
$this->media = $this->getMedia($name, $model, $this->collection); |
|
57
|
|
|
|
|
58
|
|
|
$this->componentView = $view; |
|
59
|
|
|
$this->listView = $listView ?? 'media-library::livewire.partials.collection.list'; |
|
60
|
|
|
$this->itemView = $itemView ?? 'media-library::livewire.partials.collection.item'; |
|
61
|
|
|
$this->propertiesView = $propertiesView ?? 'media-library::livewire.partials.collection.properties'; |
|
62
|
|
|
$this->fieldsView = $fieldsView ?? 'media-library::livewire.partials.collection.fields'; |
|
63
|
|
|
|
|
64
|
|
|
$this->multiple = $multiple; |
|
65
|
|
|
} |
|
66
|
|
|
|
|
67
|
|
|
public function render() |
|
68
|
|
|
{ |
|
69
|
|
|
return view('media-library::components.media-library-collection'); |
|
70
|
|
|
} |
|
71
|
|
|
} |
|
72
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths