src/PostProcessors/ApplyExtraHiddenAndVisibleAttributes.php
public function process(Model $model)
    {
        $hiddenOnModel = $model->getHidden();

        foreach ($this->unhidden as $unhidden) {

            if (($key = array_search($unhidden, $hiddenOnModel)) !== false) {

                unset($hiddenOnModel[ $key ]);
            }
        }

        $hiddenOnModel = array_merge($hiddenOnModel, $this->hidden);

        $model->setHidden($hiddenOnModel);

        return $model;
    }
public function process(Model $model)
    {
        $hiddenOnModel = $model->getHidden();

        foreach ($this->unhidden as $unhidden) {

            if (($key = array_search($unhidden, $hiddenOnModel)) !== false) {

                unset($hiddenOnModel[ $key ]);
            }
        }

        $hiddenOnModel = array_merge($hiddenOnModel, $this->hidden);

        $model->setHidden($hiddenOnModel);

        return $model;
    }
public function process ( Model $ model ) { $ hiddenOnModel = $ model -> getHidden ( ) ; foreach ( $ this -> unhidden as $ unhidden ) { if ( ( $ key = array_search ( $ unhidden , $ hiddenOnModel ) ) !== false ) { unset ( $ hiddenOnModel [ $ key ] ) ; } } $ hiddenOnModel = array_merge ( $ hiddenOnModel , $ this -> hidden ) ; $ model -> setHidden ( $ hiddenOnModel ) ; return $ model ; }
Applies processing to a single model

@param Model $model
@return Model
Applies processing to a single model