style: Laravel Pint 코드 포맷팅 적용
- PSR-12 스타일 가이드 준수 - 302개 파일 스타일 이슈 자동 수정 - 코드 로직 변경 없음 (포맷팅만)
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
class MakeModelWithRelationships extends Command
|
||||
{
|
||||
protected $signature = 'make:model-with-docs {name} {--migration} {--controller} {--resource}';
|
||||
|
||||
protected $description = '모델 생성 후 자동으로 관계 문서 업데이트';
|
||||
|
||||
public function handle()
|
||||
@@ -17,9 +18,15 @@ public function handle()
|
||||
|
||||
// 기본 모델 생성
|
||||
$options = [];
|
||||
if ($this->option('migration')) $options['--migration'] = true;
|
||||
if ($this->option('controller')) $options['--controller'] = true;
|
||||
if ($this->option('resource')) $options['--resource'] = true;
|
||||
if ($this->option('migration')) {
|
||||
$options['--migration'] = true;
|
||||
}
|
||||
if ($this->option('controller')) {
|
||||
$options['--controller'] = true;
|
||||
}
|
||||
if ($this->option('resource')) {
|
||||
$options['--resource'] = true;
|
||||
}
|
||||
|
||||
Artisan::call('make:model', array_merge(['name' => $modelName], $options));
|
||||
$this->info("✅ 모델 생성 완료: {$modelName}");
|
||||
@@ -36,8 +43,9 @@ private function addRelationshipTemplate(string $modelName): void
|
||||
{
|
||||
$modelPath = app_path("Models/{$modelName}.php");
|
||||
|
||||
if (!File::exists($modelPath)) {
|
||||
if (! File::exists($modelPath)) {
|
||||
$this->error("모델 파일을 찾을 수 없습니다: {$modelPath}");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -65,12 +73,12 @@ private function addRelationshipTemplate(string $modelName): void
|
||||
|
||||
// 클래스 끝 부분에 템플릿 삽입
|
||||
$content = str_replace(
|
||||
'}' . PHP_EOL,
|
||||
$template . PHP_EOL . '}' . PHP_EOL,
|
||||
'}'.PHP_EOL,
|
||||
$template.PHP_EOL.'}'.PHP_EOL,
|
||||
$content
|
||||
);
|
||||
|
||||
File::put($modelPath, $content);
|
||||
$this->info("📝 관계 템플릿 추가: {$modelName}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user