Skip to content

Commit 0118fe0

Browse files
authored
Merge pull request #2062 from area17/capsule-generate-remove-config-rewrite
[3.x] Revert the change that updates the config / navigation files and just…
2 parents b5f0af2 + 772bf9f commit 0118fe0

File tree

1 file changed

+3
-20
lines changed

1 file changed

+3
-20
lines changed

src/Commands/ModuleMake.php

+3-20
Original file line numberDiff line numberDiff line change
@@ -369,25 +369,13 @@ public function handle(): void
369369

370370
private function addCapsuleToConfigFile(string $name): void
371371
{
372-
$configFile = base_path('config/twill.php');
373-
if (! File::exists($configFile)) {
374-
File::put($configFile, '<?php ' . PHP_EOL . PHP_EOL . 'return [];');
375-
}
376-
377-
$navigation = require($configFile);
378-
379-
$navigation['capsules']['list'][strtolower($name)] = $newEntry = [
372+
$newEntry = [
380373
'name' => $name,
381374
'enabled' => true,
382375
];
383376

384-
$this->warn('Added capsule entry to config/twill.php:');
377+
$this->warn('Add the following capsule entry to config/twill.php:');
385378
$this->box($this->getFormattedArray($newEntry));
386-
387-
File::put(
388-
$configFile,
389-
'<?php ' . PHP_EOL . PHP_EOL . 'return ' . $this->getFormattedArray($navigation) . ';'
390-
);
391379
}
392380

393381
private function addEntryToNavigationFile(string $key, array $value): void
@@ -432,13 +420,8 @@ private function addEntryToNavigationFile(string $key, array $value): void
432420

433421
$navigation[$key] = $value;
434422

435-
$this->warn('Added navigation entry to config/twill-navigation.php:');
423+
$this->warn('Add the following navigation entry to config/twill-navigation.php:');
436424
$this->box($this->getFormattedArray([$key => $navigation[$key]]));
437-
438-
File::put(
439-
$navigationFile,
440-
'<?php ' . PHP_EOL . PHP_EOL . 'return ' . $this->getFormattedArray($navigation) . ';'
441-
);
442425
}
443426

444427
/**

0 commit comments

Comments
 (0)