29 lines
880 B
PHP
29 lines
880 B
PHP
<?php
|
|
|
|
namespace App\Console\Commands;
|
|
|
|
use Database\Seeders\EnterpriseModulesSampleSeeder;
|
|
use Illuminate\Console\Command;
|
|
|
|
class BootstrapEnterpriseModules extends Command
|
|
{
|
|
protected $signature = 'enterprise:bootstrap {--business= : Business ID to seed sample data for}';
|
|
|
|
protected $description = 'Activate enterprise modules: register versions, grant permissions, seed demo data';
|
|
|
|
public function handle(): int
|
|
{
|
|
$businessId = $this->option('business') ? (int) $this->option('business') : null;
|
|
|
|
$this->info('Bootstrapping enterprise modules...');
|
|
|
|
$seeder = new EnterpriseModulesSampleSeeder();
|
|
$seeder->setCommand($this);
|
|
$seeder->run($businessId);
|
|
|
|
$this->info('Done. Open Executive Cockpit, Quality Management, Shop Floor, and Integration Hub from the admin menu.');
|
|
|
|
return self::SUCCESS;
|
|
}
|
|
}
|