Skip to content

Commit

Permalink
update config bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
teomanofficial committed Feb 26, 2019
1 parent 5ff2af7 commit 336eb49
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Commands/MakeRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,17 +205,17 @@ protected function write($repository): void
*/
protected function updateConfig(): void
{
config("repository.map")[$this->key ?? strtolower($this->model)] = $this->model . "Repository";
$config = config("repository");
$config["map"][$this->key ?? strtolower($this->model)] = $this->model . "Repository";

$path = config_path("repository.php");

$dump = var_export(config("repository"), true);
$dump = var_export($config, true);
$dump = preg_replace('#(?:\A|\n)([ ]*)array \(#i', '[', $dump);
$dump = preg_replace('#\n([ ]*)\),#', "\n$1],", $dump);
$dump = preg_replace('#\n\)#', "\n];", $dump);
$dump = preg_replace('#=> \[\n\s+\],\n#', "=> [],\n", $dump);

$content = "<?php \n\n return " . $dump;
$path = config_path("repository.php");

file_put_contents($path, $content);
}
Expand Down

0 comments on commit 336eb49

Please sign in to comment.