1 | <?php |
||
13 | class CollectionRepository implements Repository |
||
14 | { |
||
15 | use ValidatesRequests; |
||
16 | |||
17 | /** |
||
18 | * Registered themes collection. |
||
19 | * |
||
20 | * @var array |
||
21 | */ |
||
22 | protected $themes = []; |
||
23 | |||
24 | /** |
||
25 | * @var \Symfony\Component\Finder\Finder |
||
26 | */ |
||
27 | protected $finder; |
||
28 | |||
29 | /** |
||
30 | * @var \Illuminate\Contracts\Config\Repository |
||
31 | */ |
||
32 | protected $config; |
||
33 | |||
34 | /** |
||
35 | * Repository constructor. |
||
36 | * |
||
37 | * @param \Symfony\Component\Finder\Finder $finder |
||
38 | * @param Config $config |
||
39 | */ |
||
40 | public function __construct(Finder $finder, Config $config) |
||
45 | |||
46 | /** |
||
47 | * Scan themes directory. |
||
48 | */ |
||
49 | public function scan() |
||
56 | |||
57 | /** |
||
58 | * Get themes base path. |
||
59 | * |
||
60 | * @return string |
||
61 | */ |
||
62 | public function getBasePath() |
||
66 | |||
67 | /** |
||
68 | * Register theme.json file. |
||
69 | * |
||
70 | * @param \SplFileInfo $file |
||
71 | * @throws \Exception |
||
72 | */ |
||
73 | public function register($file) |
||
100 | |||
101 | /** |
||
102 | * Get all themes. |
||
103 | * |
||
104 | * @return \Illuminate\Support\Collection |
||
105 | */ |
||
106 | public function all() |
||
110 | |||
111 | /** |
||
112 | * Get current frontend theme. |
||
113 | * |
||
114 | * @return \Yajra\CMS\Themes\Theme |
||
115 | * @throws \Yajra\CMS\Themes\Exceptions\ThemeNotFoundException |
||
116 | */ |
||
117 | public function current() |
||
121 | |||
122 | /** |
||
123 | * Find or fail a theme. |
||
124 | * |
||
125 | * @param string $theme |
||
126 | * @param string $type |
||
127 | * @return \Yajra\CMS\Themes\Theme |
||
128 | * @throws \Yajra\CMS\Themes\Exceptions\ThemeNotFoundException |
||
129 | */ |
||
130 | public function findOrFail($theme, $type = 'frontend') |
||
138 | |||
139 | /** |
||
140 | * Uninstall a theme. |
||
141 | * |
||
142 | * @param string $theme |
||
143 | * @return bool |
||
144 | */ |
||
145 | public function uninstall($theme) |
||
153 | |||
154 | /** |
||
155 | * Get directory path of the theme. |
||
156 | * |
||
157 | * @param string $theme |
||
158 | * @return string |
||
159 | */ |
||
160 | public function getDirectoryPath($theme) |
||
164 | } |
||
165 |