style: Laravel Pint 코드 포맷팅 적용

- PSR-12 스타일 가이드 준수
- 302개 파일 스타일 이슈 자동 수정
- 코드 로직 변경 없음 (포맷팅만)
This commit is contained in:
2025-11-06 17:45:49 +09:00
parent 48e76432ee
commit cc206fdbed
294 changed files with 4476 additions and 2561 deletions

View File

@@ -9,38 +9,61 @@
class Category extends Model
{
use SoftDeletes, BelongsToTenant, ModelTrait;
use BelongsToTenant, ModelTrait, SoftDeletes;
protected $fillable = [
'tenant_id','parent_id','code_group','code','name',
'tenant_id', 'parent_id', 'code_group', 'code', 'name',
'profile_code', // capability_profile 연결
'is_active','sort_order','description',
'created_by','updated_by','deleted_by'
'is_active', 'sort_order', 'description',
'created_by', 'updated_by', 'deleted_by',
];
protected $casts = [
'is_active' => 'boolean',
'is_active' => 'boolean',
'sort_order' => 'integer',
];
protected $hidden = [
'deleted_by','deleted_at'
'deleted_by', 'deleted_at',
];
// 계층
public function parent() { return $this->belongsTo(self::class, 'parent_id'); }
public function children() { return $this->hasMany(self::class, 'parent_id'); }
public function parent()
{
return $this->belongsTo(self::class, 'parent_id');
}
public function children()
{
return $this->hasMany(self::class, 'parent_id');
}
// 카테고리의 제품들
public function products() { return $this->hasMany(\App\Models\Products\Product::class, 'category_id'); }
public function products()
{
return $this->hasMany(\App\Models\Products\Product::class, 'category_id');
}
// 카테고리 필드
public function categoryFields() { return $this->hasMany(CategoryField::class, 'category_id'); }
public function categoryFields()
{
return $this->hasMany(CategoryField::class, 'category_id');
}
// 태그(폴리모픽) — 이미 taggables 존재
public function tags() { return $this->morphToMany(\App\Models\Commons\Tag::class, 'taggable'); }
public function tags()
{
return $this->morphToMany(\App\Models\Commons\Tag::class, 'taggable');
}
// 스코프
public function scopeGroup($q, string $group) { return $q->where('code_group', $group); }
public function scopeCode($q, string $code) { return $q->where('code', $code); }
public function scopeGroup($q, string $group)
{
return $q->where('code_group', $group);
}
public function scopeCode($q, string $code)
{
return $q->where('code', $code);
}
}

View File

@@ -9,21 +9,21 @@
class CategoryField extends Model
{
use SoftDeletes, BelongsToTenant, ModelTrait;
use BelongsToTenant, ModelTrait, SoftDeletes;
protected $table = 'category_fields';
protected $fillable = [
'tenant_id','category_id',
'field_key','field_name','field_type',
'is_required','sort_order','default_value','options','description',
'created_by','updated_by','deleted_by',
'tenant_id', 'category_id',
'field_key', 'field_name', 'field_type',
'is_required', 'sort_order', 'default_value', 'options', 'description',
'created_by', 'updated_by', 'deleted_by',
];
protected $casts = [
'is_required' => 'boolean',
'sort_order' => 'integer',
'options' => 'array',
'sort_order' => 'integer',
'options' => 'array',
];
public function category()
@@ -32,5 +32,8 @@ public function category()
}
// 편의 스코프
public function scopeRequired($q) { return $q->where('is_required', 1); }
public function scopeRequired($q)
{
return $q->where('is_required', 1);
}
}

View File

@@ -11,17 +11,18 @@ class CategoryLog extends Model
use BelongsToTenant, ModelTrait;
protected $table = 'category_logs';
public $timestamps = false; // changed_at 컬럼 단일 사용
protected $fillable = [
'category_id','tenant_id','action','changed_by','changed_at',
'before_json','after_json','remarks',
'category_id', 'tenant_id', 'action', 'changed_by', 'changed_at',
'before_json', 'after_json', 'remarks',
];
protected $casts = [
'changed_at' => 'datetime',
'changed_at' => 'datetime',
'before_json' => 'array',
'after_json' => 'array',
'after_json' => 'array',
];
public function category()

View File

@@ -13,14 +13,14 @@ class CategoryTemplate extends Model
protected $table = 'category_templates';
protected $fillable = [
'tenant_id','category_id','version_no','template_json','applied_at',
'created_by','updated_by','deleted_by','remarks',
'tenant_id', 'category_id', 'version_no', 'template_json', 'applied_at',
'created_by', 'updated_by', 'deleted_by', 'remarks',
];
protected $casts = [
'version_no' => 'integer',
'version_no' => 'integer',
'template_json' => 'array',
'applied_at' => 'datetime',
'applied_at' => 'datetime',
];
public function category()

View File

@@ -9,7 +9,7 @@
class Classification extends Model
{
use SoftDeletes, ModelTrait, BelongsToTenant;
use BelongsToTenant, ModelTrait, SoftDeletes;
protected $fillable = [
'tenant_id',

View File

@@ -2,9 +2,9 @@
namespace App\Models\Commons;
use App\Models\Members\User;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use App\Models\Members\User;
/**
* @mixin IdeHelperFile

View File

@@ -2,18 +2,18 @@
namespace App\Models\Commons;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use App\Models\Scopes\TenantScope;
use App\Traits\BelongsToTenant;
use App\Traits\ModelTrait;
use App\Models\Scopes\TenantScope;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
/**
* @mixin IdeHelperMenu
*/
class Menu extends Model
{
use SoftDeletes, BelongsToTenant, ModelTrait;
use BelongsToTenant, ModelTrait, SoftDeletes;
protected $fillable = [
'tenant_id', 'parent_id', 'name', 'url', 'is_active', 'sort_order',
@@ -25,7 +25,7 @@ class Menu extends Model
'created_by',
'updated_by',
'deleted_by',
'deleted_at'
'deleted_at',
];
public function parent()

View File

@@ -23,7 +23,6 @@ public function tenant(): BelongsTo
return $this->belongsTo(Tenant::class);
}
/**
* 제품(Product)와 연결 (N:M, 폴리모픽)
*/
@@ -47,5 +46,4 @@ public function materials(): MorphToMany
{
return $this->morphedByMany(Material::class, 'taggable');
}
}