orchidsoftware / orchidsoftware/platform

Add a section for overriding the value of a Cell Component using the render function

Open
#3,105 0 comments 0 reactions 1 assignee View on GitHub

@tabuna is already working on this.

Since Jun 20, 2026.

Docs
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:

  1. 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.
  2. 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 render function:

    TD::make('last_activity', __('Last Updated'))
        ->render(function (Order $order) {
            return (new DateTimeSplit(value: $order->shipped_at ?? $order->packed_at ?? $order->created_at))->render();
        })
    
  3. Lastly, add a new section (or integrate it into DateTimeSplit) with the following:

    If the updated_at column for your model defaults to null because it was created with nullable and useCurrentOnUpdate, DateTimeSplit will show the current date instead of a blank value or falling back to created_at, due to Carbon's behavior when provided with a null date. To have updated_at fall back to created_at, you can use the render function:

    TD::make('updated_at', __('Last Updated Test'))
        ->render(function (Order $order) {
            return (new DateTimeSplit(value: $order->updated_at ?? $order->created_at))->render();
        })
    

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.