Skip to content

Commit 4456144

Browse files
author
Ni Nelli
committed
chore: add TODO
refs: #204
1 parent 7c8853d commit 4456144

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Generators/ModelGenerator.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ public function prepareRelatedModels(): void
8989

9090
$this->insertImport($content, 'Illuminate\Database\Eloquent\Relations\\' . Str::ucfirst($types[$type]));
9191

92+
// TODO: use ronasit/larabuilder instead
9293
$fixedContent = preg_replace('/\}$/', "\n {$newRelation}\n}", $content);
9394

9495
$this->saveClass('models', $relation, $fixedContent);
@@ -108,6 +109,7 @@ protected function insertImport(string &$classContent, string $import): void
108109
$import = "use {$import};";
109110

110111
if (!Str::contains($classContent, $import)) {
112+
// TODO: use ronasit/larabuilder instead
111113
$classContent = preg_replace('/(namespace\s+[^;]+;\s*)/', "$1{$import}\n", $classContent, 1);
112114
}
113115
}

0 commit comments

Comments
 (0)