Skip to content

Commit

Permalink
fix theme error
Browse files Browse the repository at this point in the history
  • Loading branch information
hkp22 committed Jan 12, 2022
1 parent 1c5202a commit 9965337
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions src/ThemeServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Qirolab\Theme;

use Facade\IgnitionContracts\SolutionProviderRepository;
use Illuminate\Container\Container;
// use Illuminate\Container\Container;
use Illuminate\Contracts\Container\BindingResolutionException;
use Illuminate\Support\ServiceProvider;
use Qirolab\Theme\Commands\MakeThemeCommand;
Expand All @@ -15,19 +15,13 @@ public function boot(): void
{
if ($this->app->runningInConsole()) {
$this->publishes([
__DIR__ . '/../config/theme.php' => config_path('theme.php'),
__DIR__.'/../config/theme.php' => config_path('theme.php'),
], 'config');

$this->commands([
MakeThemeCommand::class,
]);
}

$this->mergeConfig();

$this->registerThemeFinder();

$this->registerSolutionProvider();
}

public function register()
Expand All @@ -41,7 +35,7 @@ public function register()

protected function mergeConfig(): void
{
$this->mergeConfigFrom(__DIR__ . '/../config/theme.php', 'theme');
$this->mergeConfigFrom(__DIR__.'/../config/theme.php', 'theme');
}

protected function registerSolutionProvider(): void
Expand All @@ -59,14 +53,18 @@ protected function registerSolutionProvider(): void
protected function registerThemeFinder(): void
{
$this->app->singleton('theme.finder', function ($app) {
$themeFinder = new ThemeViewFinder(
$app['files'],
$app['config']['view.paths']
);

// $themeFinder = new ThemeViewFinder(
// $app['files'],
// $app['config']['view.paths']
// Container::getInstance()->make('files'),
// Container::getInstance()->make('config')['view.paths']
// );

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

return $themeFinder;
Expand Down

0 comments on commit 9965337

Please sign in to comment.