public function addDataSource($record, $source)
    {
        if (arrayable($record)) {
            $record = $record->toArray();
        }

        if (! isset($record[$field = 'data_sources'])) {
            $record['data_sources'] = [];
        }

        $record['data_sources'][] = $source;

        return coollect($record);
    }
public function addDataSource($record, $source)
    {
        if (arrayable($record)) {
            $record = $record->toArray();
        }

        if (! isset($record[$field = 'data_sources'])) {
            $record['data_sources'] = [];
        }

        $record['data_sources'][] = $source;

        return coollect($record);
    }
public function addDataSource ( $ record , $ source ) { if ( arrayable ( $ record ) ) { $ record = $ record -> toArray ( ) ; } if ( ! isset ( $ record [ $ field = 'data_sources' ] ) ) { $ record [ 'data_sources' ] = [ ] ; } $ record [ 'data_sources' ] [ ] = $ source ; return coollect ( $ record ) ; }
Add data sources to collection.

@param \PragmaRX\Coollection\Package\Coollection $record
@param string $source
@return \PragmaRX\Coollection\Package\Coollection
Add data sources to collection .