Move, rename and remove fields
Moving fields
use ForestAdmin\AgentPHP\DatasourceCustomizer\CollectionCustomizer;
// Assuming the following structure:
// User { id, firstName, lastName, addressId }
// Address { id, streetName, streetNumber, city, countryId }
// Country { id, name }
$forestAgent->customizeCollection(
'User',
function (CollectionCustomizer $builder) {
$builder->importField('city', ['path' => 'address:city', 'readonly' => true])
->importField('country', ['path' => 'address:country:name', 'readonly' => true]);
}
);Renaming and removing fields and relations
Last updated