diff --git a/app/Http/Controllers/Admin/HR/EmployeeController.php b/app/Http/Controllers/Admin/HR/EmployeeController.php index 45027bf..3b42e8f 100644 --- a/app/Http/Controllers/Admin/HR/EmployeeController.php +++ b/app/Http/Controllers/Admin/HR/EmployeeController.php @@ -39,7 +39,7 @@ public function create(): Response public function store(EmployeeRequest $request): RedirectResponse { return $this->handleAction( - fn() => $this->service->create($request->validated()), + fn () => $this->service->create($request->validated()), 'Pegawai berhasil ditambahkan.', 'admin.hr.employees.index' ); @@ -58,7 +58,7 @@ public function edit(User $user): Response public function update(EmployeeRequest $request, User $user): RedirectResponse { return $this->handleAction( - fn() => $this->service->update($user, $request->validated()), + fn () => $this->service->update($user, $request->validated()), 'Pegawai berhasil diperbarui.', 'admin.hr.employees.index' ); @@ -67,7 +67,7 @@ public function update(EmployeeRequest $request, User $user): RedirectResponse public function destroy(User $user): RedirectResponse { return $this->handleAction( - fn() => $this->service->delete($user), + fn () => $this->service->delete($user), 'Pegawai berhasil dihapus.', 'admin.hr.employees.index' ); @@ -86,7 +86,7 @@ public function toggleActive(User $user): RedirectResponse public function resetPassword(User $user): RedirectResponse { return $this->handleAction( - fn() => $this->service->resetPassword($user), + fn () => $this->service->resetPassword($user), 'Kata sandi pegawai berhasil direset ke kata sandi default.', 'admin.hr.employees.index' ); diff --git a/app/Models/CashAccount.php b/app/Models/CashAccount.php index 7826f05..6c5b175 100644 --- a/app/Models/CashAccount.php +++ b/app/Models/CashAccount.php @@ -27,7 +27,7 @@ protected function casts(): array protected function formattedBalance(): Attribute { return Attribute::make( - get: fn () => 'Rp ' . number_format($this->balance, 0, ',', '.'), + get: fn () => 'Rp '.number_format($this->balance, 0, ',', '.'), ); } diff --git a/app/Models/CashTransaction.php b/app/Models/CashTransaction.php index d2ee439..9bf6577 100644 --- a/app/Models/CashTransaction.php +++ b/app/Models/CashTransaction.php @@ -36,14 +36,14 @@ protected function casts(): array protected function formattedAmount(): Attribute { return Attribute::make( - get: fn () => 'Rp ' . number_format($this->amount, 0, ',', '.'), + get: fn () => 'Rp '.number_format($this->amount, 0, ',', '.'), ); } protected function formattedBalanceAfter(): Attribute { return Attribute::make( - get: fn () => 'Rp ' . number_format($this->balance_after, 0, ',', '.'), + get: fn () => 'Rp '.number_format($this->balance_after, 0, ',', '.'), ); } diff --git a/app/Models/Customer.php b/app/Models/Customer.php index d1c42ae..0a5e69f 100644 --- a/app/Models/Customer.php +++ b/app/Models/Customer.php @@ -27,7 +27,7 @@ protected function formattedPhoneNumber(): Attribute { return Attribute::make( get: fn () => $this->phone_number - ? substr($this->phone_number, 0, 4) . ' ' . substr($this->phone_number, 4, 4) . ' ' . substr($this->phone_number, 8) + ? substr($this->phone_number, 0, 4).' '.substr($this->phone_number, 4, 4).' '.substr($this->phone_number, 8) : null, set: fn (?string $value) => $value ? preg_replace('/\s/', '', $value) : null, ); diff --git a/app/Models/Cutting.php b/app/Models/Cutting.php index 7d46e30..8a52a42 100644 --- a/app/Models/Cutting.php +++ b/app/Models/Cutting.php @@ -36,21 +36,21 @@ protected function casts(): array protected function formattedCostPerUnit(): Attribute { return Attribute::make( - get: fn () => 'Rp ' . number_format($this->cost_per_unit, 0, ',', '.'), + get: fn () => 'Rp '.number_format($this->cost_per_unit, 0, ',', '.'), ); } protected function formattedOtherCost(): Attribute { return Attribute::make( - get: fn () => 'Rp ' . number_format($this->other_cost, 0, ',', '.'), + get: fn () => 'Rp '.number_format($this->other_cost, 0, ',', '.'), ); } protected function formattedSewingCost(): Attribute { return Attribute::make( - get: fn () => 'Rp ' . number_format($this->sewing_cost, 0, ',', '.'), + get: fn () => 'Rp '.number_format($this->sewing_cost, 0, ',', '.'), ); } @@ -64,7 +64,7 @@ protected function statusLabel(): Attribute protected function formattedTotalMaterialCost(): Attribute { return Attribute::make( - get: fn () => 'Rp ' . number_format($this->total_material_cost, 0, ',', '.'), + get: fn () => 'Rp '.number_format($this->total_material_cost, 0, ',', '.'), ); } diff --git a/app/Models/Employee.php b/app/Models/Employee.php index fc75bbc..73326a0 100644 --- a/app/Models/Employee.php +++ b/app/Models/Employee.php @@ -33,7 +33,7 @@ protected function casts(): array protected function formattedBaseSalary(): Attribute { return Attribute::make( - get: fn () => 'Rp ' . number_format($this->base_salary, 0, ',', '.'), + get: fn () => 'Rp '.number_format($this->base_salary, 0, ',', '.'), ); } diff --git a/app/Models/EmployeeAdvance.php b/app/Models/EmployeeAdvance.php index 5c46789..89df7fe 100644 --- a/app/Models/EmployeeAdvance.php +++ b/app/Models/EmployeeAdvance.php @@ -34,7 +34,7 @@ protected function casts(): array protected function formattedAmount(): Attribute { return Attribute::make( - get: fn () => 'Rp ' . number_format($this->amount, 0, ',', '.'), + get: fn () => 'Rp '.number_format($this->amount, 0, ',', '.'), ); } @@ -55,7 +55,7 @@ protected function formattedDueDate(): Attribute protected function formattedPaidAmount(): Attribute { return Attribute::make( - get: fn () => 'Rp ' . number_format($this->paid_amount, 0, ',', '.'), + get: fn () => 'Rp '.number_format($this->paid_amount, 0, ',', '.'), ); } diff --git a/app/Models/Expense.php b/app/Models/Expense.php index 22dd3e2..70b81c2 100644 --- a/app/Models/Expense.php +++ b/app/Models/Expense.php @@ -29,7 +29,7 @@ protected function casts(): array protected function formattedAmount(): Attribute { return Attribute::make( - get: fn () => 'Rp ' . number_format($this->amount, 0, ',', '.'), + get: fn () => 'Rp '.number_format($this->amount, 0, ',', '.'), ); } diff --git a/app/Models/Order.php b/app/Models/Order.php index ac1766f..c0b193f 100644 --- a/app/Models/Order.php +++ b/app/Models/Order.php @@ -52,21 +52,21 @@ protected function channelLabel(): Attribute protected function formattedCogs(): Attribute { return Attribute::make( - get: fn () => 'Rp ' . number_format($this->cogs, 0, ',', '.'), + get: fn () => 'Rp '.number_format($this->cogs, 0, ',', '.'), ); } protected function formattedDiscount(): Attribute { return Attribute::make( - get: fn () => 'Rp ' . number_format($this->discount, 0, ',', '.'), + get: fn () => 'Rp '.number_format($this->discount, 0, ',', '.'), ); } protected function formattedNegoPrice(): Attribute { return Attribute::make( - get: fn () => 'Rp ' . number_format($this->nego_price, 0, ',', '.'), + get: fn () => 'Rp '.number_format($this->nego_price, 0, ',', '.'), ); } @@ -87,14 +87,14 @@ protected function statusLabel(): Attribute protected function formattedSubtotal(): Attribute { return Attribute::make( - get: fn () => 'Rp ' . number_format($this->subtotal, 0, ',', '.'), + get: fn () => 'Rp '.number_format($this->subtotal, 0, ',', '.'), ); } protected function formattedTotalAmount(): Attribute { return Attribute::make( - get: fn () => 'Rp ' . number_format($this->total_amount, 0, ',', '.'), + get: fn () => 'Rp '.number_format($this->total_amount, 0, ',', '.'), ); } diff --git a/app/Models/OrderItem.php b/app/Models/OrderItem.php index 773bf5f..c01e099 100644 --- a/app/Models/OrderItem.php +++ b/app/Models/OrderItem.php @@ -39,14 +39,14 @@ protected function stockQualityLabel(): Attribute protected function formattedSubtotal(): Attribute { return Attribute::make( - get: fn () => 'Rp ' . number_format($this->subtotal, 0, ',', '.'), + get: fn () => 'Rp '.number_format($this->subtotal, 0, ',', '.'), ); } protected function formattedUnitPrice(): Attribute { return Attribute::make( - get: fn () => 'Rp ' . number_format($this->unit_price, 0, ',', '.'), + get: fn () => 'Rp '.number_format($this->unit_price, 0, ',', '.'), ); } diff --git a/app/Models/Payroll.php b/app/Models/Payroll.php index 03adde4..f61dc81 100644 --- a/app/Models/Payroll.php +++ b/app/Models/Payroll.php @@ -35,28 +35,28 @@ protected function casts(): array protected function formattedBaseSalary(): Attribute { return Attribute::make( - get: fn () => 'Rp ' . number_format($this->base_salary, 0, ',', '.'), + get: fn () => 'Rp '.number_format($this->base_salary, 0, ',', '.'), ); } protected function formattedBonusAmount(): Attribute { return Attribute::make( - get: fn () => 'Rp ' . number_format($this->bonus_amount, 0, ',', '.'), + get: fn () => 'Rp '.number_format($this->bonus_amount, 0, ',', '.'), ); } protected function formattedDeductionAmount(): Attribute { return Attribute::make( - get: fn () => 'Rp ' . number_format($this->deduction_amount, 0, ',', '.'), + get: fn () => 'Rp '.number_format($this->deduction_amount, 0, ',', '.'), ); } protected function formattedAmount(): Attribute { return Attribute::make( - get: fn () => 'Rp ' . number_format($this->attributes['total_amount'] ?? 0, 0, ',', '.'), + get: fn () => 'Rp '.number_format($this->attributes['total_amount'] ?? 0, 0, ',', '.'), ); } @@ -70,7 +70,7 @@ protected function statusLabel(): Attribute protected function formattedTotalAmount(): Attribute { return Attribute::make( - get: fn () => 'Rp ' . number_format($this->total_amount, 0, ',', '.'), + get: fn () => 'Rp '.number_format($this->total_amount, 0, ',', '.'), ); } diff --git a/app/Models/PayrollAdjustment.php b/app/Models/PayrollAdjustment.php index 07d940a..22e8b88 100644 --- a/app/Models/PayrollAdjustment.php +++ b/app/Models/PayrollAdjustment.php @@ -30,7 +30,7 @@ protected function casts(): array protected function formattedAmount(): Attribute { return Attribute::make( - get: fn () => 'Rp ' . number_format($this->amount, 0, ',', '.'), + get: fn () => 'Rp '.number_format($this->amount, 0, ',', '.'), ); } diff --git a/app/Models/ProductPrice.php b/app/Models/ProductPrice.php index bb457e0..bc508f1 100644 --- a/app/Models/ProductPrice.php +++ b/app/Models/ProductPrice.php @@ -29,7 +29,7 @@ protected function casts(): array protected function formattedPrice(): Attribute { return Attribute::make( - get: fn () => 'Rp ' . number_format($this->price, 0, ',', '.'), + get: fn () => 'Rp '.number_format($this->price, 0, ',', '.'), ); } diff --git a/app/Models/Purchase.php b/app/Models/Purchase.php index fd995d9..b920041 100644 --- a/app/Models/Purchase.php +++ b/app/Models/Purchase.php @@ -32,28 +32,28 @@ protected function casts(): array protected function formattedDiscount(): Attribute { return Attribute::make( - get: fn () => 'Rp ' . number_format($this->discount, 0, ',', '.'), + get: fn () => 'Rp '.number_format($this->discount, 0, ',', '.'), ); } protected function formattedShippingCost(): Attribute { return Attribute::make( - get: fn () => 'Rp ' . number_format($this->shipping_cost, 0, ',', '.'), + get: fn () => 'Rp '.number_format($this->shipping_cost, 0, ',', '.'), ); } protected function formattedSubtotal(): Attribute { return Attribute::make( - get: fn () => 'Rp ' . number_format($this->subtotal, 0, ',', '.'), + get: fn () => 'Rp '.number_format($this->subtotal, 0, ',', '.'), ); } protected function formattedTotal(): Attribute { return Attribute::make( - get: fn () => 'Rp ' . number_format($this->total, 0, ',', '.'), + get: fn () => 'Rp '.number_format($this->total, 0, ',', '.'), ); } diff --git a/app/Models/PurchaseItem.php b/app/Models/PurchaseItem.php index 264e45f..91ad2c7 100644 --- a/app/Models/PurchaseItem.php +++ b/app/Models/PurchaseItem.php @@ -28,14 +28,14 @@ protected function casts(): array protected function formattedSubtotal(): Attribute { return Attribute::make( - get: fn () => 'Rp ' . number_format($this->subtotal, 0, ',', '.'), + get: fn () => 'Rp '.number_format($this->subtotal, 0, ',', '.'), ); } protected function formattedUnitPrice(): Attribute { return Attribute::make( - get: fn () => 'Rp ' . number_format($this->unit_price, 0, ',', '.'), + get: fn () => 'Rp '.number_format($this->unit_price, 0, ',', '.'), ); } diff --git a/app/Models/RawMaterialPrice.php b/app/Models/RawMaterialPrice.php index 33bed38..5c7e517 100644 --- a/app/Models/RawMaterialPrice.php +++ b/app/Models/RawMaterialPrice.php @@ -34,7 +34,7 @@ protected function casts(): array protected function formattedPrice(): Attribute { return Attribute::make( - get: fn () => 'Rp ' . number_format($this->price, 0, ',', '.'), + get: fn () => 'Rp '.number_format($this->price, 0, ',', '.'), ); } diff --git a/app/Models/Restock.php b/app/Models/Restock.php index f0bf58d..9350a7a 100644 --- a/app/Models/Restock.php +++ b/app/Models/Restock.php @@ -41,14 +41,14 @@ protected function stockTypeLabel(): Attribute protected function formattedSubtotal(): Attribute { return Attribute::make( - get: fn () => 'Rp ' . number_format($this->subtotal, 0, ',', '.'), + get: fn () => 'Rp '.number_format($this->subtotal, 0, ',', '.'), ); } protected function formattedTotal(): Attribute { return Attribute::make( - get: fn () => 'Rp ' . number_format($this->total, 0, ',', '.'), + get: fn () => 'Rp '.number_format($this->total, 0, ',', '.'), ); } diff --git a/app/Models/RestockItem.php b/app/Models/RestockItem.php index 43e64a6..f8064fd 100644 --- a/app/Models/RestockItem.php +++ b/app/Models/RestockItem.php @@ -28,14 +28,14 @@ protected function casts(): array protected function formattedSubtotal(): Attribute { return Attribute::make( - get: fn () => 'Rp ' . number_format($this->subtotal, 0, ',', '.'), + get: fn () => 'Rp '.number_format($this->subtotal, 0, ',', '.'), ); } protected function formattedUnitPrice(): Attribute { return Attribute::make( - get: fn () => 'Rp ' . number_format($this->unit_price, 0, ',', '.'), + get: fn () => 'Rp '.number_format($this->unit_price, 0, ',', '.'), ); } diff --git a/app/Models/Supplier.php b/app/Models/Supplier.php index aecbb3c..5e17952 100644 --- a/app/Models/Supplier.php +++ b/app/Models/Supplier.php @@ -27,7 +27,7 @@ protected function formattedPhoneNumber(): Attribute { return Attribute::make( get: fn () => $this->phone_number - ? substr($this->phone_number, 0, 4) . ' ' . substr($this->phone_number, 4, 4) . ' ' . substr($this->phone_number, 8) + ? substr($this->phone_number, 0, 4).' '.substr($this->phone_number, 4, 4).' '.substr($this->phone_number, 8) : null, set: fn (?string $value) => $value ? preg_replace('/\s/', '', $value) : null, ); diff --git a/app/Models/UserProfile.php b/app/Models/UserProfile.php index de5f13f..6f179b6 100644 --- a/app/Models/UserProfile.php +++ b/app/Models/UserProfile.php @@ -45,7 +45,7 @@ protected function formattedPhoneNumber(): Attribute { return Attribute::make( get: fn () => $this->phone_number - ? substr($this->phone_number, 0, 4) . ' ' . substr($this->phone_number, 4, 4) . ' ' . substr($this->phone_number, 8) + ? substr($this->phone_number, 0, 4).' '.substr($this->phone_number, 4, 4).' '.substr($this->phone_number, 8) : null, set: fn (?string $value) => $value ? preg_replace('/\s/', '', $value) : null, ); diff --git a/app/Services/Admin/Finance/EmployeeAdvanceService.php b/app/Services/Admin/Finance/EmployeeAdvanceService.php index 0cd24f2..5497aee 100644 --- a/app/Services/Admin/Finance/EmployeeAdvanceService.php +++ b/app/Services/Admin/Finance/EmployeeAdvanceService.php @@ -2,10 +2,8 @@ namespace App\Services\Admin\Finance; -use App\Enums\CashTransactionType; use App\Enums\EmployeeAdvanceStatus; use App\Models\CashAccount; -use App\Models\CashTransaction; use App\Models\EmployeeAdvance; use App\Services\Concerns\HandlesCashTransactions; use App\Services\NotificationService; @@ -17,6 +15,7 @@ class EmployeeAdvanceService { use HandlesCashTransactions; + public function getAll(array $filters = []): Collection { return EmployeeAdvance::select('id', 'employee_id', 'amount', 'paid_amount', 'description', 'due_date', 'status', 'created_at') diff --git a/app/Services/Admin/Finance/ExpenseService.php b/app/Services/Admin/Finance/ExpenseService.php index 5f99c9c..5006ab2 100644 --- a/app/Services/Admin/Finance/ExpenseService.php +++ b/app/Services/Admin/Finance/ExpenseService.php @@ -2,9 +2,7 @@ namespace App\Services\Admin\Finance; -use App\Enums\CashTransactionType; use App\Models\CashAccount; -use App\Models\CashTransaction; use App\Models\Expense; use App\Services\Concerns\HandlesCashTransactions; use App\Services\Concerns\RegistersMedia; diff --git a/app/Services/Admin/Finance/PayrollPeriodService.php b/app/Services/Admin/Finance/PayrollPeriodService.php index 9511b00..89138c3 100644 --- a/app/Services/Admin/Finance/PayrollPeriodService.php +++ b/app/Services/Admin/Finance/PayrollPeriodService.php @@ -2,11 +2,8 @@ namespace App\Services\Admin\Finance; -use App\Enums\CashTransactionType; use App\Enums\PayrollPeriodStatus; use App\Enums\PayrollStatus; -use App\Models\CashAccount; -use App\Models\CashTransaction; use App\Models\Payroll; use App\Models\PayrollPeriod; use App\Services\Concerns\HandlesCashTransactions; @@ -19,6 +16,7 @@ class PayrollPeriodService { use HandlesCashTransactions; + public function getAll(array $filters = []): Collection { return PayrollPeriod::select('id', 'year', 'month', 'status', 'closed_at', 'created_at') diff --git a/app/Services/Admin/HR/EmployeeService.php b/app/Services/Admin/HR/EmployeeService.php index d396a8d..11c2002 100644 --- a/app/Services/Admin/HR/EmployeeService.php +++ b/app/Services/Admin/HR/EmployeeService.php @@ -14,13 +14,13 @@ public function getAll(array $filters = []): Collection return User::select(['id', 'email', 'username', 'is_active']) ->where(fn ($q) => $q->whereHas('employee')->orWhereHas('roles', fn ($rq) => $rq->where('name', 'Owner'))) ->with([ - 'userProfile' => fn($q) => $q->select('id', 'user_id', 'full_name', 'phone_number', 'gender'), - 'employee' => fn($q) => $q->select('id', 'user_id', 'join_date', 'employment_status', 'base_salary'), - 'roles' => fn($q) => $q->select('id', 'name'), + 'userProfile' => fn ($q) => $q->select('id', 'user_id', 'full_name', 'phone_number', 'gender'), + 'employee' => fn ($q) => $q->select('id', 'user_id', 'join_date', 'employment_status', 'base_salary'), + 'roles' => fn ($q) => $q->select('id', 'name'), ]) - ->when($filters['employment_status'] ?? null, fn($q, $status) => $q->whereHas('employee', fn($eq) => $eq->where('employment_status', $status))) - ->when(isset($filters['is_active']) && $filters['is_active'] !== '', fn($q) => $q->where('is_active', filter_var($filters['is_active'], FILTER_VALIDATE_BOOLEAN))) - ->when($filters['gender'] ?? null, fn($q, $gender) => $q->whereHas('userProfile', fn($uq) => $uq->where('gender', $gender))) + ->when($filters['employment_status'] ?? null, fn ($q, $status) => $q->whereHas('employee', fn ($eq) => $eq->where('employment_status', $status))) + ->when(isset($filters['is_active']) && $filters['is_active'] !== '', fn ($q) => $q->where('is_active', filter_var($filters['is_active'], FILTER_VALIDATE_BOOLEAN))) + ->when($filters['gender'] ?? null, fn ($q, $gender) => $q->whereHas('userProfile', fn ($uq) => $uq->where('gender', $gender))) ->latest() ->get(); } @@ -31,14 +31,14 @@ public function paginated(int $perPage = 25, string $search = '', string $sort = ->select(['id', 'email', 'username', 'is_active']) ->where(fn ($q) => $q->whereHas('employee')->orWhereHas('roles', fn ($rq) => $rq->where('name', 'Owner'))) ->with([ - 'userProfile' => fn($q) => $q->select('id', 'user_id', 'full_name', 'phone_number', 'gender'), - 'employee' => fn($q) => $q->select('id', 'user_id', 'join_date', 'employment_status', 'base_salary'), - 'roles' => fn($q) => $q->select('id', 'name'), + 'userProfile' => fn ($q) => $q->select('id', 'user_id', 'full_name', 'phone_number', 'gender'), + 'employee' => fn ($q) => $q->select('id', 'user_id', 'join_date', 'employment_status', 'base_salary'), + 'roles' => fn ($q) => $q->select('id', 'name'), ]) - ->when($search, fn($q) => $q->whereHas('userProfile', fn($uq) => $uq->where('full_name', 'like', "%{$search}%"))) - ->when($filters['employment_status'] ?? null, fn($q, $status) => $q->whereHas('employee', fn($eq) => $eq->where('employment_status', $status))) - ->when(isset($filters['is_active']) && $filters['is_active'] !== '', fn($q) => $q->where('is_active', filter_var($filters['is_active'], FILTER_VALIDATE_BOOLEAN))) - ->when($filters['gender'] ?? null, fn($q, $gender) => $q->whereHas('userProfile', fn($uq) => $uq->where('gender', $gender))) + ->when($search, fn ($q) => $q->whereHas('userProfile', fn ($uq) => $uq->where('full_name', 'like', "%{$search}%"))) + ->when($filters['employment_status'] ?? null, fn ($q, $status) => $q->whereHas('employee', fn ($eq) => $eq->where('employment_status', $status))) + ->when(isset($filters['is_active']) && $filters['is_active'] !== '', fn ($q) => $q->where('is_active', filter_var($filters['is_active'], FILTER_VALIDATE_BOOLEAN))) + ->when($filters['gender'] ?? null, fn ($q, $gender) => $q->whereHas('userProfile', fn ($uq) => $uq->where('gender', $gender))) ->orderBy($sort, $direction) ->paginate($perPage); } diff --git a/app/Services/Admin/Manage/RestockService.php b/app/Services/Admin/Manage/RestockService.php index c945876..bab77d2 100644 --- a/app/Services/Admin/Manage/RestockService.php +++ b/app/Services/Admin/Manage/RestockService.php @@ -241,5 +241,4 @@ private function buildItemRows(array $items, string $stockType, $now, int &$subt ]; })->toArray(); } - } diff --git a/app/Services/Concerns/HandlesCashTransactions.php b/app/Services/Concerns/HandlesCashTransactions.php index 03a21b8..a499f30 100644 --- a/app/Services/Concerns/HandlesCashTransactions.php +++ b/app/Services/Concerns/HandlesCashTransactions.php @@ -5,7 +5,6 @@ use App\Enums\CashTransactionType; use App\Models\CashAccount; use App\Models\CashTransaction; -use Illuminate\Support\Facades\DB; use Illuminate\Validation\ValidationException; trait HandlesCashTransactions diff --git a/app/Services/Concerns/HasStockAdjustment.php b/app/Services/Concerns/HasStockAdjustment.php index 04f9485..0bf54f3 100644 --- a/app/Services/Concerns/HasStockAdjustment.php +++ b/app/Services/Concerns/HasStockAdjustment.php @@ -3,6 +3,7 @@ namespace App\Services\Concerns; use App\Enums\ProductStockQuality; +use App\Models\ProductVariant; use Illuminate\Database\Eloquent\Model; trait HasStockAdjustment @@ -26,7 +27,7 @@ private function adjustVariantStock(int $variantId, int $quantity, int $sign, st $field = self::QUALITY_STOCK_MAP[$stockType] ?? 'stock'; $this->adjustStock( - model: app(\App\Models\ProductVariant::class)->newQuery()->findOrFail($variantId), + model: app(ProductVariant::class)->newQuery()->findOrFail($variantId), field: $field, quantity: $quantity, sign: $sign, diff --git a/database/seeders/RolePermissionSeeder.php b/database/seeders/RolePermissionSeeder.php index ed4d3fd..6ed6aa5 100644 --- a/database/seeders/RolePermissionSeeder.php +++ b/database/seeders/RolePermissionSeeder.php @@ -60,7 +60,7 @@ public function run(): void $developerOwnerPerms = array_values(array_filter( $allPermissions, - fn($p) => ! in_array($p, $excludedFromDeveloperOwner, true) + fn ($p) => ! in_array($p, $excludedFromDeveloperOwner, true) )); $rolePermissions = [