orchidsoftware / orchidsoftware/platform
Add a section for overriding the value of a Cell Component using the render function
@tabuna is already working on this.
Since Jun 20, 2026.
- Dominant language
- PHP
- Stars
- 4.8k
- Forks
- 662
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 7
Description
Problem/task description:
The (https://orchid.software/en/docs/table/)[Table] and (https://orchid.software/en/docs/cell-types/)[Cell Types] documentation are lacking instructions to modify values before they are sent to Components.
Expected outcome:
Users will be able to learn how, on a Column by Column basis, to manipulate values before they're sent to Components without needing to create custom attributes on models or create/maintain custom Components that duplicate functionality of existing ones.
Proposed solution:
- First, either tweak the title of (https://orchid.software/en/docs/table/#customizing-component-values)[Customizing Component Values] to "Customizing Component Arguments" or integrate the information into Using Components; the point of this section appears to be demonstrating how the constructor arguments can be changed to work with individual values rather than a Model object. The word "Values" here is confusing, because it is the arguments being customized, not the incoming data.
- Second, add a new section to the Table documentation, after the arguments customization info, titled something like "Overriding Values Before Rendering with Components", with the following:
If you need to override a value before it gets rendered by a Component, you can do so with the
renderfunction:TD::make('last_activity', __('Last Updated')) ->render(function (Order $order) { return (new DateTimeSplit(value: $order->shipped_at ?? $order->packed_at ?? $order->created_at))->render(); }) - Lastly, add a new section (or integrate it into DateTimeSplit) with the following:
If the
updated_atcolumn for your model defaults to null because it was created withnullableanduseCurrentOnUpdate, DateTimeSplit will show the current date instead of a blank value or falling back tocreated_at, due to Carbon's behavior when provided with a null date. To haveupdated_atfall back tocreated_at, you can use therenderfunction:TD::make('updated_at', __('Last Updated Test')) ->render(function (Order $order) { return (new DateTimeSplit(value: $order->updated_at ?? $order->created_at))->render(); })
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.