public function keys(Model $model)
    {
        $pk = $model->getKeyName();

        $pool = [
            [$pk],
            $model->getVisible(),
            $model->getHidden(),
            $model->getFillable(),
            $model->getGuarded(),
            $model->getDates(),
            array_keys($this->getCasts($model))
        ];

        // SoftDeletingTrait
        if (method_exists($model, 'getDeletedAtColumn')) {
            $pool[] = [$model->getDeletedAtColumn()];
        }

        $keysByKey = [];

        foreach ($pool as $i=>$keys) {
            foreach ($keys as $key) {
                if ($keys == ['*'] || $keys == '*') {
                    continue;
                }

                $keysByKey[$key] = true;
            }
        }

        return array_keys($keysByKey);
    }
public function keys(Model $model)
    {
        $pk = $model->getKeyName();

        $pool = [
            [$pk],
            $model->getVisible(),
            $model->getHidden(),
            $model->getFillable(),
            $model->getGuarded(),
            $model->getDates(),
            array_keys($this->getCasts($model))
        ];

        // SoftDeletingTrait
        if (method_exists($model, 'getDeletedAtColumn')) {
            $pool[] = [$model->getDeletedAtColumn()];
        }

        $keysByKey = [];

        foreach ($pool as $i=>$keys) {
            foreach ($keys as $key) {
                if ($keys == ['*'] || $keys == '*') {
                    continue;
                }

                $keysByKey[$key] = true;
            }
        }

        return array_keys($keysByKey);
    }
public function keys ( Model $ model ) { $ pk = $ model -> getKeyName ( ) ; $ pool = [ [ $ pk ] , $ model -> getVisible ( ) , $ model -> getHidden ( ) , $ model -> getFillable ( ) , $ model -> getGuarded ( ) , $ model -> getDates ( ) , array_keys ( $ this -> getCasts ( $ model ) ) ] ; // SoftDeletingTrait if ( method_exists ( $ model , 'getDeletedAtColumn' ) ) { $ pool [ ] = [ $ model -> getDeletedAtColumn ( ) ] ; } $ keysByKey = [ ] ; foreach ( $ pool as $ i => $ keys ) { foreach ( $ keys as $ key ) { if ( $ keys == [ '*' ] || $ keys == '*' ) { continue ; } $ keysByKey [ $ key ] = true ; } } return array_keys ( $ keysByKey ) ; }
Guess the available keys by standard eloquent mechanisms like casts,
timestamps, fillable,...

@param Model $model

@return array
Guess the available keys by standard eloquent mechanisms like casts timestamps fillable ...