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

@@ -2,14 +2,13 @@
namespace App\Services;
use Illuminate\Support\Facades\Hash;
use App\Models\Members\User;
use App\Models\Tenants\Tenant;
use App\Models\Members\UserTenant;
use App\Models\Tenants\Tenant;
use Illuminate\Support\Facades\Hash;
class MemberService
{
/**
* 회원 조회(리스트)
*/
@@ -19,7 +18,7 @@ public static function getMembers($request)
$pageNo = $request->page ?? 1;
$pageSize = $request->size ?? 10;
$query = User::whereHas('userTenants', function($q) {
$query = User::whereHas('userTenants', function ($q) {
$q->active();
})->debug();
$query = $query->paginate($pageSize, ['*'], 'page', $pageNo);
@@ -28,19 +27,18 @@ public static function getMembers($request)
}
/**
* 단일 회원 조회
*/
public static function getMember(int $userNo)
{
$query = User::whereHas('userTenants', function($q) {
$query = User::whereHas('userTenants', function ($q) {
$q->active();
})->where('id', $userNo);
return $query->first();
}
/**
* 내정보 확인
*/
@@ -51,7 +49,7 @@ public static function getMyInfo()
$data['user'] = $user;
$tenantId = app('tenant_id');
if($tenantId){
if ($tenantId) {
$tenant = Tenant::find($tenantId);
$data['tenant'] = $tenant;
}
@@ -67,10 +65,9 @@ public static function getMyUpdate($request)
$apiUser = app('api_user');
// 요청으로 받은 수정 데이터 유효성 검사
$validatedData = $request->validate([
'name' => 'sometimes|string|max:255',
'name' => 'sometimes|string|max:255',
'phone' => 'sometimes|string|max:20',
'email' => 'sometimes|email|max:100',
'options' => 'nullable|json',
@@ -79,7 +76,7 @@ public static function getMyUpdate($request)
$user = User::find($apiUser);
if (!$user) {
if (! $user) {
return ['error' => 'User not found.', 'code' => 404];
}
@@ -100,7 +97,7 @@ public static function setMyPassword($request)
// 유효성 검사 (확인 비밀번호는 선택)
$validated = $request->validate([
'current_password' => 'required|string',
'new_password' => 'required|string|min:8|max:64',
'new_password' => 'required|string|min:8|max:64',
]);
// 선택적으로 확인 비밀번호가 온 경우 체크
@@ -111,12 +108,12 @@ public static function setMyPassword($request)
// 유저 조회
$user = User::find($apiUserId);
if (!$user) {
if (! $user) {
return ['error' => '유저를 찾을 수 없음', 'code' => 404];
}
// 현재 비밀번호 확인
if (!Hash::check($validated['current_password'], $user->password)) {
if (! Hash::check($validated['current_password'], $user->password)) {
return ['error' => '현재 비밀번호가 일치하지 않습니다.', 'code' => 400];
}
@@ -148,13 +145,12 @@ public static function getMyTenants()
'tenants.id',
'tenants.company_name',
'user_tenants.is_active',
'user_tenants.is_default'
'user_tenants.is_default',
]);
return $data;
}
/**
* 나의 테넌트 전환
*/
@@ -175,7 +171,7 @@ public static function switchMyTenant(int $tenantId)
->where('tenant_id', $tenantId)
->update(['is_default' => 1]);
if (!$updated) {
if (! $updated) {
return ['error' => '해당 테넌트를 찾을 수 없습니다.', 'code' => 404];
}