, truncated: bool} */ public static function execute(SocialAccount $account): array { $result = app(PinterestPublisher::class)->getBoards($account); $boards = Collection::make(data_get($result, 'boards', [])) ->map(fn (mixed $board): array => [ 'id' => (string) data_get($board, 'id'), 'name' => (string) data_get($board, 'name'), ]) ->filter(fn (array $board): bool => $board['id'] !== '') ->values() ->all(); return [ 'boards' => $boards, 'truncated' => (bool) data_get($result, 'truncated', false), ]; } }