1 | <?php |
||
11 | class Repository |
||
12 | { |
||
13 | use ValidatesRequests; |
||
14 | |||
15 | /** |
||
16 | * Registered themes collection. |
||
17 | * |
||
18 | * @var array |
||
19 | */ |
||
20 | protected $themes = []; |
||
21 | |||
22 | /** |
||
23 | * @var \Symfony\Component\Finder\Finder |
||
24 | */ |
||
25 | protected $finder; |
||
26 | |||
27 | /** |
||
28 | * @var \Illuminate\Contracts\Config\Repository |
||
29 | */ |
||
30 | protected $config; |
||
31 | |||
32 | /** |
||
33 | * Repository constructor. |
||
34 | * |
||
35 | * @param \Symfony\Component\Finder\Finder $finder |
||
36 | * @param Config $config |
||
37 | */ |
||
38 | public function __construct(Finder $finder, Config $config) |
||
43 | |||
44 | /** |
||
45 | * Scan themes directory. |
||
46 | */ |
||
47 | public function scan() |
||
54 | |||
55 | /** |
||
56 | * Register theme.json file. |
||
57 | * |
||
58 | * @param \SplFileInfo $file |
||
59 | * @throws \Exception |
||
60 | */ |
||
61 | public function register($file) |
||
86 | |||
87 | /** |
||
88 | * Get all themes. |
||
89 | * |
||
90 | * @return \Illuminate\Support\Collection |
||
91 | */ |
||
92 | public function all() |
||
96 | |||
97 | /** |
||
98 | * Get current frontend theme. |
||
99 | * |
||
100 | * @return \Yajra\CMS\Theme\Theme |
||
101 | * @throws \Yajra\CMS\Theme\NotFoundException |
||
102 | */ |
||
103 | public function current() |
||
107 | |||
108 | /** |
||
109 | * Find or fail a theme. |
||
110 | * |
||
111 | * @param string $theme |
||
112 | * @return \Yajra\CMS\Theme\Theme |
||
113 | * @throws \Yajra\CMS\Theme\NotFoundException |
||
114 | */ |
||
115 | public function findOrFail($theme) |
||
123 | |||
124 | /** |
||
125 | * Uninstall a theme. |
||
126 | * |
||
127 | * @param string $theme |
||
128 | * @return bool |
||
129 | */ |
||
130 | public function uninstall($theme) |
||
138 | |||
139 | /** |
||
140 | * Get directory path of the theme. |
||
141 | * |
||
142 | * @param string $theme |
||
143 | * @return string |
||
144 | */ |
||
145 | public function getDirectoryPath($theme) |
||
149 | |||
150 | /** |
||
151 | * Get themes base path. |
||
152 | * |
||
153 | * @return string |
||
154 | */ |
||
155 | public function getBasePath() |
||
159 | } |
||
160 |