From c0c8470b0250bfabdaebf3747d51eae794dbb0e0 Mon Sep 17 00:00:00 2001 From: Yoga Pangestu Date: Wed, 29 Jul 2026 00:59:45 +0700 Subject: [PATCH] refactor: replace Hidden attribute with Guarded in model classes for improved attribute management --- app/Models/AppNotification.php | 4 ++-- app/Models/Attendance.php | 4 ++-- app/Models/CashAccount.php | 4 ++-- app/Models/CashTransaction.php | 6 +++--- app/Models/Category.php | 4 ++-- app/Models/Customer.php | 4 ++-- app/Models/Cutting.php | 6 +++--- app/Models/CuttingMaterial.php | 4 ++-- app/Models/CuttingMaterialCombination.php | 4 ++-- app/Models/CuttingResult.php | 4 ++-- app/Models/Employee.php | 6 +++--- app/Models/EmployeeAdvance.php | 6 +++--- app/Models/Expense.php | 4 ++-- app/Models/HomepageConfiguration.php | 4 ++-- app/Models/LeaveRequest.php | 6 +++--- app/Models/Order.php | 8 ++++---- app/Models/OrderItem.php | 6 +++--- app/Models/OwnerVerificationRequest.php | 4 ++-- app/Models/Payroll.php | 6 +++--- app/Models/PayrollAdjustment.php | 6 +++--- app/Models/PayrollPeriod.php | 6 +++--- app/Models/Product.php | 4 ++-- app/Models/ProductCategory.php | 4 ++-- app/Models/ProductPrice.php | 6 +++--- app/Models/ProductVariant.php | 4 ++-- app/Models/Purchase.php | 4 ++-- app/Models/PurchaseItem.php | 4 ++-- app/Models/PushSubscription.php | 4 ++-- app/Models/RawMaterial.php | 4 ++-- app/Models/RawMaterialPrice.php | 4 ++-- app/Models/Rejection.php | 4 ++-- app/Models/Restock.php | 6 +++--- app/Models/RestockItem.php | 4 ++-- app/Models/RetailStockHistory.php | 4 ++-- app/Models/StockMutation.php | 4 ++-- app/Models/StokOpname.php | 6 +++--- app/Models/StokOpnameItem.php | 6 +++--- app/Models/Supplier.php | 5 ++--- app/Models/SystemConfiguration.php | 4 ++-- app/Models/User.php | 9 +++------ app/Models/UserProfile.php | 6 +++--- 41 files changed, 99 insertions(+), 103 deletions(-) diff --git a/app/Models/AppNotification.php b/app/Models/AppNotification.php index aba071b..d43e4d0 100644 --- a/app/Models/AppNotification.php +++ b/app/Models/AppNotification.php @@ -1,13 +1,13 @@ $this->userProfile?->full_name ?? '', + get: fn () => $this->userProfile?->full_name ?? '', ); } diff --git a/app/Models/UserProfile.php b/app/Models/UserProfile.php index 3eb3a3f..feb731e 100644 --- a/app/Models/UserProfile.php +++ b/app/Models/UserProfile.php @@ -2,16 +2,16 @@ namespace App\Models; -use Illuminate\Database\Eloquent\Attributes\Hidden; +use App\Enums\Gender; +use Illuminate\Database\Eloquent\Attributes\Guarded; use Illuminate\Database\Eloquent\Attributes\Scope; use Illuminate\Database\Eloquent\Builder; -use App\Enums\Gender; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\SoftDeletes; -#[Hidden(['id'])] +#[Guarded(['id'])] class UserProfile extends Model { use HasFactory, SoftDeletes;