src/Actions/LogAction.php
protected function getContent()
    {
        $template = $this->option('template');
        $data = $this->form->data();

        if ($template) {
            $content = $this->getTemplate($template, [
                'data' => $data,
                'options' => $this->options
            ]);
        } else {
            $visitor = App::instance()->visitor();
            $content = '['.date('c').'] '.$visitor->ip().' '.$visitor->userAgent();

            foreach ($data as $key => $value) {
                if (is_array($value)) {
                    $value = implode(', ', array_filter($value, function ($i) {
                        return $i !== '';
                    }));
                }
                $content .= "\n{$key}: {$value}";
            }
            $content .= "\n\n";
        }

        return $content;
    }
protected function getContent()
    {
        $template = $this->option('template');
        $data = $this->form->data();

        if ($template) {
            $content = $this->getTemplate($template, [
                'data' => $data,
                'options' => $this->options
            ]);
        } else {
            $visitor = App::instance()->visitor();
            $content = '['.date('c').'] '.$visitor->ip().' '.$visitor->userAgent();

            foreach ($data as $key => $value) {
                if (is_array($value)) {
                    $value = implode(', ', array_filter($value, function ($i) {
                        return $i !== '';
                    }));
                }
                $content .= "\n{$key}: {$value}";
            }
            $content .= "\n\n";
        }

        return $content;
    }
protected function getContent ( ) { $ template = $ this -> option ( 'template' ) ; $ data = $ this -> form -> data ( ) ; if ( $ template ) { $ content = $ this -> getTemplate ( $ template , [ 'data' => $ data , 'options' => $ this -> options ] ) ; } else { $ visitor = App :: instance ( ) -> visitor ( ) ; $ content = '[' . date ( 'c' ) . '] ' . $ visitor -> ip ( ) . ' ' . $ visitor -> userAgent ( ) ; foreach ( $ data as $ key => $ value ) { if ( is_array ( $ value ) ) { $ value = implode ( ', ' , array_filter ( $ value , function ( $ i ) { return $ i !== '' ; } ) ) ; } $ content .= "\n{$key}: {$value}" ; } $ content .= "\n\n" ; } return $ content ; }
Get the content of the log entry

@return string
Get the content of the log entry