src/Classes/BaseChart.php
public function formatDatasets()
    {
        // This little boy was commented because it's not compatible
        // in laravel < 5.4
        //
        // return Collection::make($this->datasets)
        //     ->each
        //     ->matchValues(count($this->labels))
        //     ->map
        //     ->format($this->labels)
        //     ->toJson();

        return Encoder::encode(
            Collection::make($this->datasets)
                ->each(function ($dataset) {
                    $dataset->matchValues(count($this->labels));
                })
                ->map(function ($dataset) {
                    return $dataset->format($this->labels);
                })
                ->toArray()
        );
    }
public function formatDatasets()
    {
        // This little boy was commented because it's not compatible
        // in laravel < 5.4
        //
        // return Collection::make($this->datasets)
        //     ->each
        //     ->matchValues(count($this->labels))
        //     ->map
        //     ->format($this->labels)
        //     ->toJson();

        return Encoder::encode(
            Collection::make($this->datasets)
                ->each(function ($dataset) {
                    $dataset->matchValues(count($this->labels));
                })
                ->map(function ($dataset) {
                    return $dataset->format($this->labels);
                })
                ->toArray()
        );
    }
public function formatDatasets ( ) { // This little boy was commented because it's not compatible // in laravel < 5.4 // // return Collection::make($this->datasets) //     ->each //     ->matchValues(count($this->labels)) //     ->map //     ->format($this->labels) //     ->toJson(); return Encoder :: encode ( Collection :: make ( $ this -> datasets ) -> each ( function ( $ dataset ) { $ dataset -> matchValues ( count ( $ this -> labels ) ) ; } ) -> map ( function ( $ dataset ) { return $ dataset -> format ( $ this -> labels ) ; } ) -> toArray ( ) ) ; }
Formats the datasets for the output.

@return string
Formats the datasets for the output .