src/Services/NestableService.php
public function make($data)
    {
        if ($data instanceof Collection) {
            $this->data = collect($data->toArray());
        } elseif (is_array($data)) {
            $this->data = collect($data);
        } else {
            throw new InvalidArgumentException('Invalid data type.');
        }

        $this->config = Config::get('nestable');

        $this->parent = $this->config['parent'];

        $this->primary_key = $this->config['primary_key'];

        return $this;
    }
public function make($data)
    {
        if ($data instanceof Collection) {
            $this->data = collect($data->toArray());
        } elseif (is_array($data)) {
            $this->data = collect($data);
        } else {
            throw new InvalidArgumentException('Invalid data type.');
        }

        $this->config = Config::get('nestable');

        $this->parent = $this->config['parent'];

        $this->primary_key = $this->config['primary_key'];

        return $this;
    }
public function make ( $ data ) { if ( $ data instanceof Collection ) { $ this -> data = collect ( $ data -> toArray ( ) ) ; } elseif ( is_array ( $ data ) ) { $ this -> data = collect ( $ data ) ; } else { throw new InvalidArgumentException ( 'Invalid data type.' ) ; } $ this -> config = Config :: get ( 'nestable' ) ; $ this -> parent = $ this -> config [ 'parent' ] ; $ this -> primary_key = $ this -> config [ 'primary_key' ] ; return $ this ; }
Set the data to wrap class.

@param mixed $data

@return object (instance)
Set the data to wrap class .