-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
23 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
title: Translated Keys | ||
nav_order: 8 | ||
--- | ||
|
||
# Translated Keys | ||
|
||
The Logger class provides the `attributeMap` property, which allows you to map field keys to make translations user-friendly. This is particularly useful when you want to present field names in a more readable or user-friendly manner. | ||
Here's how you can use the attributeMap property: | ||
|
||
```php | ||
public static ?array $attributeMap = [ | ||
'name' => 'first_name', | ||
'media' => 'avatar', | ||
]; | ||
``` | ||
|
||
In this example, the `attributeMap` property is defined to map the field keys 'name' to 'first_name' and 'media' to 'avatar'. This mapping allows you to present these fields with more descriptive and user-friendly names in the activity log views or any other related components. | ||
|
||
For instance, instead of displaying `name` in the logs, the attribute will be shown as `first_name`, providing a clearer understanding of the logged information. You can configure these mappings based on your application's specific needs, making the logs more accessible and meaningful for users. |
2 changes: 1 addition & 1 deletion
2
docs/006-usage-with-relations.md → docs/007-usage-with-relations.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
title: Usage with Relations | ||
nav_order: 8 | ||
nav_order: 9 | ||
--- | ||
|
||
# Usage with Relations | ||
|
2 changes: 1 addition & 1 deletion
2
docs/007-complex-field-or-relation.md → docs/008-complex-field-or-relation.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
title: Complex Field/Relation | ||
nav_order: 9 | ||
nav_order: 10 | ||
--- | ||
|
||
# Complex Field/Relation | ||
|
2 changes: 1 addition & 1 deletion
2
docs/008-link-causer-subject.md → docs/009-link-causer-subject.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
title: Link Causer/Subject | ||
nav_order: 10 | ||
nav_order: 11 | ||
--- | ||
|
||
# Link Causer/Subject | ||
|