Textarea::make('public-key') ->live() ->visible(fn (Get $get) => $get('credential_id') !== null && $get('ssh-key') !== null) ->formatStateUsing(function (Get $get) { if ($get('credential_id') !== null) { $credential = Credential::find($get('credential_id')); $client = new ApiClient($credential->id); return $client?->getSshKeys()?->first()['public_key']; } })