src/Classes/Markdown.php
public function markdownPosts($dir = null)
    {

        $source = collect($this->markdownFiles($dir));

        if (empty($source)) {
            return false;
        }

        //map files
        $files = $source->map(
            function ($file) {

                    $array = $this->markdownToArray($file);
                    $arr['url'] = $array['url'];
                    $arr['last_modified'] = $array['last_modified'];
                    $arr['time_ago'] = $array['time_ago'];
                    $arr['link'] = $array['link'];
                    $arr['title'] = $array['title'];
                    $arr['excerpt'] = $array['excerpt'];
                    $arr['content'] = $array['content'];
                    return $arr;

            }
        );

        return $files;

    }
public function markdownPosts($dir = null)
    {

        $source = collect($this->markdownFiles($dir));

        if (empty($source)) {
            return false;
        }

        //map files
        $files = $source->map(
            function ($file) {

                    $array = $this->markdownToArray($file);
                    $arr['url'] = $array['url'];
                    $arr['last_modified'] = $array['last_modified'];
                    $arr['time_ago'] = $array['time_ago'];
                    $arr['link'] = $array['link'];
                    $arr['title'] = $array['title'];
                    $arr['excerpt'] = $array['excerpt'];
                    $arr['content'] = $array['content'];
                    return $arr;

            }
        );

        return $files;

    }
public function markdownPosts ( $ dir = null ) { $ source = collect ( $ this -> markdownFiles ( $ dir ) ) ; if ( empty ( $ source ) ) { return false ; } //map files $ files = $ source -> map ( function ( $ file ) { $ array = $ this -> markdownToArray ( $ file ) ; $ arr [ 'url' ] = $ array [ 'url' ] ; $ arr [ 'last_modified' ] = $ array [ 'last_modified' ] ; $ arr [ 'time_ago' ] = $ array [ 'time_ago' ] ; $ arr [ 'link' ] = $ array [ 'link' ] ; $ arr [ 'title' ] = $ array [ 'title' ] ; $ arr [ 'excerpt' ] = $ array [ 'excerpt' ] ; $ arr [ 'content' ] = $ array [ 'content' ] ; return $ arr ; } ) ; return $ files ; }
Return and array of markdown

@param  string $dir location of md directory
@return mixed
Return and array of markdown