FrozenNode / Laravel-Administrator

An administrative interface package for Laravel
http://administrator.frozennode.com/
MIT License
1.94k stars 503 forks source link

Custom Output for edit field? #1022

Open timbroder opened 8 years ago

timbroder commented 8 years ago

I'd like a few of my relationship-based edit fields to, instead of the relationship selector, show custom html so I can link to that entity's admin page.

Similar to how I can do it for a col:

        'savingsAccount' => [
            'output' => function ($value) {
                if ($value) {
                    $id = $value->id;
                    return "<a href=\"/admin/savingsaccounts/$id\">$id</a>";
                }
            }

Is this possible? (this also would help me hack around morph relationships in #191)

Thanks in advance

gregoryloichot commented 8 years ago

That would be great, especially for relationship types.