protected function evalToolbarButtons()
    {
        $buttons = $this->getConfig('view[toolbarButtons]');

        if ($buttons === false) {
            return null;
        }
        elseif (is_string($buttons)) {
            return array_map('trim', explode('|', $buttons));
        }
        elseif (is_array($buttons)) {
            return $buttons;
        }

        if ($this->manageMode == 'pivot') {
            return ['add', 'remove'];
        }

        switch ($this->relationType) {
            case 'hasMany':
            case 'morphMany':
            case 'morphToMany':
            case 'morphedByMany':
            case 'belongsToMany':
                return ['create', 'add', 'delete', 'remove'];

            case 'hasOne':
            case 'morphOne':
            case 'belongsTo':
                return ['create', 'update', 'link', 'delete', 'unlink'];
        }
    }
protected function evalToolbarButtons()
    {
        $buttons = $this->getConfig('view[toolbarButtons]');

        if ($buttons === false) {
            return null;
        }
        elseif (is_string($buttons)) {
            return array_map('trim', explode('|', $buttons));
        }
        elseif (is_array($buttons)) {
            return $buttons;
        }

        if ($this->manageMode == 'pivot') {
            return ['add', 'remove'];
        }

        switch ($this->relationType) {
            case 'hasMany':
            case 'morphMany':
            case 'morphToMany':
            case 'morphedByMany':
            case 'belongsToMany':
                return ['create', 'add', 'delete', 'remove'];

            case 'hasOne':
            case 'morphOne':
            case 'belongsTo':
                return ['create', 'update', 'link', 'delete', 'unlink'];
        }
    }
protected function evalToolbarButtons ( ) { $ buttons = $ this -> getConfig ( 'view[toolbarButtons]' ) ; if ( $ buttons === false ) { return null ; } elseif ( is_string ( $ buttons ) ) { return array_map ( 'trim' , explode ( '|' , $ buttons ) ) ; } elseif ( is_array ( $ buttons ) ) { return $ buttons ; } if ( $ this -> manageMode == 'pivot' ) { return [ 'add' , 'remove' ] ; } switch ( $ this -> relationType ) { case 'hasMany' : case 'morphMany' : case 'morphToMany' : case 'morphedByMany' : case 'belongsToMany' : return [ 'create' , 'add' , 'delete' , 'remove' ] ; case 'hasOne' : case 'morphOne' : case 'belongsTo' : return [ 'create' , 'update' , 'link' , 'delete' , 'unlink' ] ; } }
Determine the default buttons based on the model relationship type.
@return string
Determine the default buttons based on the model relationship type .