<?php class UserModel { protected const DEFAULT_ALLOWED_FIELDS = [ 'username', 'status', 'status_message', 'active', 'last_active', 'deleted_at', ]; // ... other properties protected $allowedFields = self::DEFAULT_ALLOWED_FIELDS; // ... other properties } class MyModel extends UserModel { protected $allowedFields = [ ...self::DEFAULT_ALLOWED_FIELDS, 'phone_number', 'tax_id', ]; } $model = new MyModel(); $property = new ReflectionProperty($model, 'allowedFields'); $property->setAccessible(true); var_dump($property->getValue($model));
You have javascript disabled. You will not be able to edit any code.