for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Rawilk\LaravelModules\Laravel;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Foundation\AliasLoader;
use Illuminate\Foundation\ProviderRepository;
use Illuminate\Support\Str;
use Rawilk\LaravelModules\Module as BaseModule;
class Module extends BaseModule
{
/**
* Get the path to the cached *_module.php file.
*
* @return string
*/
public function getCachedServicesPath(): string
return Str::replaceLast('services.php', $this->getSnakeName() . '_module.php', $this->app->getCachedServicesPath());
}
public function registerAliases(): void
$loader = AliasLoader::getInstance();
foreach ($this->get('aliases', []) as $aliasName => $aliasClass) {
$loader->alias($aliasName, $aliasClass);
public function registerProviders(): void
(new ProviderRepository($this->app, new Filesystem, $this->getCachedServicesPath()))
->load($this->get('providers', []));