|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Adminetic\Website\Http\Livewire\Admin\Block; |
|
4
|
|
|
|
|
5
|
|
|
use Adminetic\Website\Models\Admin\Block; |
|
6
|
|
|
use Illuminate\Support\Facades\Cache; |
|
7
|
|
|
use Livewire\Component; |
|
|
|
|
|
|
8
|
|
|
|
|
9
|
|
|
class BlockVc extends Component |
|
10
|
|
|
{ |
|
11
|
|
|
public $activeblocks = []; |
|
12
|
|
|
|
|
13
|
|
|
public function mount() |
|
14
|
|
|
{ |
|
15
|
|
|
$activeblocks = []; |
|
16
|
|
|
$block_groups = Block::where('active', 1)->get()->groupBy(['theme', 'type']); |
|
17
|
|
|
foreach ($block_groups as $theme => $types) { |
|
18
|
|
|
foreach ($types as $type => $blocks) { |
|
19
|
|
|
foreach ($blocks as $block) { |
|
20
|
|
|
$activeblocks[$theme][$type] = $block->id; |
|
21
|
|
|
} |
|
22
|
|
|
} |
|
23
|
|
|
} |
|
24
|
|
|
$this->activeblocks = $activeblocks; |
|
25
|
|
|
} |
|
26
|
|
|
|
|
27
|
|
|
public function updateBlockOrder($lists) |
|
28
|
|
|
{ |
|
29
|
|
|
foreach ($lists as $list) { |
|
30
|
|
|
Block::find($list['value'])->update(['position' => $list['order']]); |
|
31
|
|
|
} |
|
32
|
|
|
$this->emit('reorderingComplete'); |
|
33
|
|
|
} |
|
34
|
|
|
|
|
35
|
|
|
public function updatedActiveblocks() |
|
36
|
|
|
{ |
|
37
|
|
|
$block_ids = array(); |
|
38
|
|
|
foreach ($this->activeblocks as $types) { |
|
39
|
|
|
foreach ($types as $type => $block_id) { |
|
40
|
|
|
$block_ids[] = $block_id; |
|
41
|
|
|
} |
|
42
|
|
|
} |
|
43
|
|
|
|
|
44
|
|
|
if (isset($block_ids)) { |
|
45
|
|
|
foreach ($block_ids as $block_id) { |
|
46
|
|
|
$block = Block::find($block_id); |
|
47
|
|
|
$block->update(['active' => 1]); |
|
48
|
|
|
$blocks = Block::where([ |
|
49
|
|
|
['id', '<>', $block->id], |
|
50
|
|
|
['type', '=', $block->type], |
|
51
|
|
|
['theme', '=', $block->theme], |
|
52
|
|
|
])->pluck('id')->toArray(); |
|
53
|
|
|
|
|
54
|
|
|
Block::whereIn('id', $blocks)->update(['active' => 0]); |
|
55
|
|
|
} |
|
56
|
|
|
$this->emit('blockVcComplete'); |
|
57
|
|
|
} |
|
58
|
|
|
} |
|
59
|
|
|
|
|
60
|
|
|
public function render() |
|
61
|
|
|
{ |
|
62
|
|
|
$blocks = Block::all()->groupBy(['theme', 'type']); |
|
63
|
|
|
|
|
64
|
|
|
return view('website::livewire.admin.block.block-vc', compact('blocks')); |
|
65
|
|
|
} |
|
66
|
|
|
} |
|
67
|
|
|
|
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