src/SlackDriver.php
private function convertQuestion(Question $question)
    {
        $questionData = $question->toArray();

        $buttons = Collection::make($question->getButtons())->map(function ($button) {
            if ($button['type'] === 'select') {
                return $button;
            }

            return array_merge([
                'name' => $button['name'],
                'text' => $button['text'],
                'image_url' => $button['image_url'],
                'type' => $button['type'],
                'value' => $button['value'],
            ], $button['additional']);
        })->toArray();
        $questionData['actions'] = $buttons;

        return $questionData;
    }
private function convertQuestion(Question $question)
    {
        $questionData = $question->toArray();

        $buttons = Collection::make($question->getButtons())->map(function ($button) {
            if ($button['type'] === 'select') {
                return $button;
            }

            return array_merge([
                'name' => $button['name'],
                'text' => $button['text'],
                'image_url' => $button['image_url'],
                'type' => $button['type'],
                'value' => $button['value'],
            ], $button['additional']);
        })->toArray();
        $questionData['actions'] = $buttons;

        return $questionData;
    }
private function convertQuestion ( Question $ question ) { $ questionData = $ question -> toArray ( ) ; $ buttons = Collection :: make ( $ question -> getButtons ( ) ) -> map ( function ( $ button ) { if ( $ button [ 'type' ] === 'select' ) { return $ button ; } return array_merge ( [ 'name' => $ button [ 'name' ] , 'text' => $ button [ 'text' ] , 'image_url' => $ button [ 'image_url' ] , 'type' => $ button [ 'type' ] , 'value' => $ button [ 'value' ] , ] , $ button [ 'additional' ] ) ; } ) -> toArray ( ) ; $ questionData [ 'actions' ] = $ buttons ; return $ questionData ; }
Convert a Question object into a valid Slack response.

@param \BotMan\BotMan\Messages\Outgoing\Question $question
@return array
Convert a Question object into a valid Slack response .