@@ -23,19 +23,19 @@ |
||
23 | 23 | |
24 | 24 | /** @var \Spatie\MediaLibrary\MediaCollections\Models\Media $media */ |
25 | 25 | $media = $temporaryUpload->media()->create([ |
26 | - 'name' => $request->name, |
|
27 | - 'uuid' => $request->uuid, |
|
28 | - 'collection_name' => 'default', |
|
29 | - 'file_name' => $request->name, |
|
30 | - 'mime_type' => $request->content_type, |
|
31 | - 'disk' => $diskName, |
|
32 | - 'conversions_disk' => $diskName, |
|
33 | - 'manipulations' => [], |
|
34 | - 'custom_properties' => [], |
|
35 | - 'responsive_images' => [], |
|
36 | - 'generated_conversions' => [], |
|
37 | - 'size' => $request->size, |
|
38 | - ]); |
|
26 | + 'name' => $request->name, |
|
27 | + 'uuid' => $request->uuid, |
|
28 | + 'collection_name' => 'default', |
|
29 | + 'file_name' => $request->name, |
|
30 | + 'mime_type' => $request->content_type, |
|
31 | + 'disk' => $diskName, |
|
32 | + 'conversions_disk' => $diskName, |
|
33 | + 'manipulations' => [], |
|
34 | + 'custom_properties' => [], |
|
35 | + 'responsive_images' => [], |
|
36 | + 'generated_conversions' => [], |
|
37 | + 'size' => $request->size, |
|
38 | + ]); |
|
39 | 39 | |
40 | 40 | /** @var \Spatie\MediaLibrary\Support\PathGenerator\PathGenerator $pathGenerator */ |
41 | 41 | $pathGenerator = PathGeneratorFactory::create($media); |
@@ -80,7 +80,7 @@ |
||
80 | 80 | ][$attribute] : null; |
81 | 81 | } |
82 | 82 | |
83 | - // Accessors |
|
83 | + // Accessors |
|
84 | 84 | public function getImageAttribute() |
85 | 85 | { |
86 | 86 | return ! is_null($this->getFirstMedia('image')) ? $this->getFirstMediaUrl('image') : asset('adminetic/static/placeholder.jpg'); |
@@ -74,9 +74,9 @@ |
||
74 | 74 | return $qry->where('active', 1); |
75 | 75 | } |
76 | 76 | |
77 | - // Accessors |
|
78 | - public function getImageAttribute() |
|
79 | - { |
|
80 | - return ! is_null($this->getFirstMedia('image')) ? $this->getFirstMediaUrl('image') : asset('adminetic/static/slider.jpg'); |
|
81 | - } |
|
77 | + // Accessors |
|
78 | + public function getImageAttribute() |
|
79 | + { |
|
80 | + return ! is_null($this->getFirstMedia('image')) ? $this->getFirstMediaUrl('image') : asset('adminetic/static/slider.jpg'); |
|
81 | + } |
|
82 | 82 | } |
@@ -42,14 +42,14 @@ |
||
42 | 42 | { |
43 | 43 | return LogOptions::defaults(); |
44 | 44 | } |
45 | - // Accessors |
|
46 | - public function getImageAttribute() |
|
47 | - { |
|
48 | - return ! is_null($this->getFirstMedia('image')) ? $this->getFirstMediaUrl('image') : asset('adminetic/static/placeholder.jpg'); |
|
49 | - } |
|
50 | - |
|
51 | - public function scopeActive($qry) |
|
52 | - { |
|
53 | - return $qry->where('active', 1); |
|
54 | - } |
|
45 | + // Accessors |
|
46 | + public function getImageAttribute() |
|
47 | + { |
|
48 | + return ! is_null($this->getFirstMedia('image')) ? $this->getFirstMediaUrl('image') : asset('adminetic/static/placeholder.jpg'); |
|
49 | + } |
|
50 | + |
|
51 | + public function scopeActive($qry) |
|
52 | + { |
|
53 | + return $qry->where('active', 1); |
|
54 | + } |
|
55 | 55 | } |
@@ -43,14 +43,14 @@ |
||
43 | 43 | return LogOptions::defaults(); |
44 | 44 | } |
45 | 45 | |
46 | - // Accessors |
|
47 | - public function getImageAttribute() |
|
48 | - { |
|
49 | - return ! is_null($this->getFirstMedia('image')) ? $this->getFirstMediaUrl('image') : asset('adminetic/static/placeholder.jpg'); |
|
50 | - } |
|
51 | - |
|
52 | - public function scopeActive($qry) |
|
53 | - { |
|
54 | - return $qry->where('active', 1); |
|
55 | - } |
|
46 | + // Accessors |
|
47 | + public function getImageAttribute() |
|
48 | + { |
|
49 | + return ! is_null($this->getFirstMedia('image')) ? $this->getFirstMediaUrl('image') : asset('adminetic/static/placeholder.jpg'); |
|
50 | + } |
|
51 | + |
|
52 | + public function scopeActive($qry) |
|
53 | + { |
|
54 | + return $qry->where('active', 1); |
|
55 | + } |
|
56 | 56 | } |
@@ -44,18 +44,18 @@ |
||
44 | 44 | } |
45 | 45 | |
46 | 46 | // Accessors |
47 | - public function getImageAttribute() |
|
48 | - { |
|
49 | - return ! is_null($this->getFirstMedia('image')) ? $this->getFirstMediaUrl('image') : asset('adminetic/static/placeholder.jpg'); |
|
50 | - } |
|
51 | - |
|
52 | - public function getIconImageAttribute() |
|
53 | - { |
|
54 | - return ! is_null($this->getFirstMedia('icon_image')) ? $this->getFirstMediaUrl('icon_image') : asset('adminetic/static/placeholder.jpg'); |
|
55 | - } |
|
56 | - |
|
57 | - public function scopeActive($qry) |
|
58 | - { |
|
59 | - return $qry->where('active', 1); |
|
60 | - } |
|
47 | + public function getImageAttribute() |
|
48 | + { |
|
49 | + return ! is_null($this->getFirstMedia('image')) ? $this->getFirstMediaUrl('image') : asset('adminetic/static/placeholder.jpg'); |
|
50 | + } |
|
51 | + |
|
52 | + public function getIconImageAttribute() |
|
53 | + { |
|
54 | + return ! is_null($this->getFirstMedia('icon_image')) ? $this->getFirstMediaUrl('icon_image') : asset('adminetic/static/placeholder.jpg'); |
|
55 | + } |
|
56 | + |
|
57 | + public function scopeActive($qry) |
|
58 | + { |
|
59 | + return $qry->where('active', 1); |
|
60 | + } |
|
61 | 61 | } |