Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions src/FileRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Nwidart\Modules;

use Countable;
use Illuminate\Cache\CacheManager;
use Illuminate\Container\Container;
use Illuminate\Contracts\Config\Repository as ConfigRepository;
use Illuminate\Contracts\Routing\UrlGenerator;
Expand Down Expand Up @@ -59,11 +58,6 @@ abstract class FileRepository implements Countable, RepositoryInterface
*/
private Filesystem $files;

/**
* Cache Manager
*/
private CacheManager $cache;

private static $modules = [];

/**
Expand All @@ -76,7 +70,6 @@ public function __construct(Container $app, ?string $path = null)
$this->url = $app['url'];
$this->config = $app['config'];
$this->files = $app['files'];
$this->cache = $app['cache'];
}

/**
Expand Down
25 changes: 13 additions & 12 deletions src/LaravelModulesServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,6 @@ public function boot()
{
$this->registerNamespaces();

$this->app->singleton(
ModuleManifest::class,
fn () => new ModuleManifest(
new Filesystem,
app(Contracts\RepositoryInterface::class)->getScanPaths(),
$this->getCachedModulePath(),
app(ActivatorInterface::class)
)
);

$this->registerModules();

AboutCommand::add('Laravel-Modules', [
'Version' => fn () => InstalledVersions::getPrettyVersion('nwidart/laravel-modules'),
]);
Expand All @@ -58,6 +46,8 @@ public function register()
$this->registerTranslations();

$this->mergeConfigFrom(__DIR__.'/../config/config.php', 'modules');

$this->registerModules();
}

/**
Expand Down Expand Up @@ -98,6 +88,17 @@ protected function registerServices()
return new $class($app);
});
$this->app->alias(Contracts\RepositoryInterface::class, 'modules');

$this->app->singleton(
ModuleManifest::class,
fn() => new ModuleManifest(
new Filesystem,
app(Contracts\RepositoryInterface::class)->getScanPaths(),
$this->getCachedModulePath(),
app(ActivatorInterface::class)
)
);

}

protected function registerMigrations(): void
Expand Down