API Reference
Configuration
Every key of the osdd config, its default, and where to set it.
The package reads the osdd config key:
technical/osdd/config/osdd.php
return [
'layers' => [
'paths' => [
'functional' => base_path('functional'),
'technical' => base_path('technical'),
],
],
'boundaries' => [
'ignore' => [],
],
'events' => [
'discover' => false,
],
];
| Key | Default | Description |
|---|---|---|
layers.paths.functional | base_path('functional') | Bucket of the business layers |
layers.paths.technical | base_path('technical') | Bucket of the infrastructure layers. Add more keys to add buckets. |
boundaries.ignore | [] | Class prefixes and layer pairs that osdd:check does not report, see Ignoring a dependency |
events.discover | false | Discover the listeners of every layer, see Events. Must be a boolean. |
The key of each path is also the vendor of the layers created in it: osdd:layer functional/orders creates the layer in the functional path. See Buckets.
Where to set it
osdd:start deletes the root config/ folder and creates the technical/osdd layer instead. Its provider overrides the package defaults with the layer's file:
technical/osdd/src/Providers/OsddServiceProvider.php
<?php
namespace Technical\Osdd\Providers;
use Lomkit\Osdd\LayerServiceProvider;
use Lomkit\Osdd\Seeders\LayersSeeder;
class OsddServiceProvider extends LayerServiceProvider
{
public function boot(): void
{
if ($this->app->runningInConsole()) {
$this->loadMigrationsFrom(__DIR__ . '/../../database/migrations');
}
}
public function register(): void
{
$this->overrideConfigFrom(__DIR__ . '/../../config/osdd.php', 'osdd');
$this->app->bind('DatabaseSeeder', LayersSeeder::class);
}
}
The provider also loads the cache and jobs migrations of the skeleton, and binds LayersSeeder as the default seeder of db:seed.
Technical\Osdd\Providers\OsddServiceProvider belongs to your application. The package's own provider is Lomkit\Osdd\OsddServiceProvider.The package does not publish its config file: vendor:publish has nothing to copy for Lomkit\Osdd\OsddServiceProvider. Change the settings in technical/osdd/config/osdd.php. A project that keeps its root config/ folder can also create config/osdd.php by hand.