Devise\Support\DeviseEloquentAddons::newInstanceWithOldInput PHP Method

newInstanceWithOldInput() public method

Lets us get a new instance populated with old input if there is any input
public newInstanceWithOldInput ( ) : EloquentModel
return EloquentModel
    public function newInstanceWithOldInput()
    {
        $instance = new static();
        foreach (\Input::old() as $key => $value) {
            if (\Schema::hasColumn($instance->getTable(), $key)) {
                $instance->{$key} = $value;
            }
        }
        return $instance;
    }
DeviseEloquentAddons