Skip to content

Commit 9965337

Browse files
committed
fix theme error
1 parent 1c5202a commit 9965337

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

src/ThemeServiceProvider.php

+12-14
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace Qirolab\Theme;
44

55
use Facade\IgnitionContracts\SolutionProviderRepository;
6-
use Illuminate\Container\Container;
6+
// use Illuminate\Container\Container;
77
use Illuminate\Contracts\Container\BindingResolutionException;
88
use Illuminate\Support\ServiceProvider;
99
use Qirolab\Theme\Commands\MakeThemeCommand;
@@ -15,19 +15,13 @@ public function boot(): void
1515
{
1616
if ($this->app->runningInConsole()) {
1717
$this->publishes([
18-
__DIR__ . '/../config/theme.php' => config_path('theme.php'),
18+
__DIR__.'/../config/theme.php' => config_path('theme.php'),
1919
], 'config');
2020

2121
$this->commands([
2222
MakeThemeCommand::class,
2323
]);
2424
}
25-
26-
$this->mergeConfig();
27-
28-
$this->registerThemeFinder();
29-
30-
$this->registerSolutionProvider();
3125
}
3226

3327
public function register()
@@ -41,7 +35,7 @@ public function register()
4135

4236
protected function mergeConfig(): void
4337
{
44-
$this->mergeConfigFrom(__DIR__ . '/../config/theme.php', 'theme');
38+
$this->mergeConfigFrom(__DIR__.'/../config/theme.php', 'theme');
4539
}
4640

4741
protected function registerSolutionProvider(): void
@@ -59,14 +53,18 @@ protected function registerSolutionProvider(): void
5953
protected function registerThemeFinder(): void
6054
{
6155
$this->app->singleton('theme.finder', function ($app) {
56+
$themeFinder = new ThemeViewFinder(
57+
$app['files'],
58+
$app['config']['view.paths']
59+
);
60+
6261
// $themeFinder = new ThemeViewFinder(
63-
// $app['files'],
64-
// $app['config']['view.paths']
62+
// Container::getInstance()->make('files'),
63+
// Container::getInstance()->make('config')['view.paths']
6564
// );
6665

67-
$themeFinder = new ThemeViewFinder(
68-
Container::getInstance()->make('files'),
69-
Container::getInstance()->make('config')['view.paths']
66+
$themeFinder->setHints(
67+
$this->app->make('view')->getFinder()->getHints()
7068
);
7169

7270
return $themeFinder;

0 commit comments

Comments
 (0)