-
Notifications
You must be signed in to change notification settings - Fork 0
/
DatabaseBundle.php
54 lines (46 loc) · 1.51 KB
/
DatabaseBundle.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
declare(strict_types=1);
namespace Pandawa\Bundle\DatabaseBundle;
use Illuminate\Database\Console\DbCommand;
use Illuminate\Database\Console\DumpCommand;
use Illuminate\Database\Console\PruneCommand;
use Illuminate\Database\Console\Seeds\SeedCommand;
use Illuminate\Database\Console\Seeds\SeederMakeCommand;
use Illuminate\Database\Console\WipeCommand;
use Illuminate\Database\MigrationServiceProvider;
use Pandawa\Bundle\DependencyInjectionBundle\Plugin\ImportServicesPlugin;
use Pandawa\Bundle\FoundationBundle\Plugin\ImportConfigurationPlugin;
use Pandawa\Bundle\FoundationBundle\Plugin\RegisterBundlesPlugin;
use Pandawa\Component\Foundation\Bundle\Bundle;
use Pandawa\Contracts\Foundation\HasPluginInterface;
/**
* @author Iqbal Maulana <iq.bluejack@gmail.com>
*/
class DatabaseBundle extends Bundle implements HasPluginInterface
{
protected array $commands = [
DbCommand::class,
PruneCommand::class,
WipeCommand::class,
DumpCommand::class,
SeedCommand::class,
];
protected array $devCommands = [
SeederMakeCommand::class,
];
protected array $providers = [
MigrationServiceProvider::class,
];
public function configure(): void
{
$this->app->loadConsoles([...$this->devCommands, ...$this->commands]);
}
public function plugins(): array
{
return [
new RegisterBundlesPlugin($this->providers),
new ImportConfigurationPlugin(),
new ImportServicesPlugin(),
];
}
}