public function mutate($name, $attributes)
    {
        // snake_case to camelCase
        $modelClass = "\\NEM\\Models\\" . Str::studly($name);

        if (!class_exists($modelClass)) {
            throw new BadMethodCallException("Model class '" . $modelClass . "' could not be found in \\NEM\\Model namespace.");
        }

        //XXX add fields list to Models
        $instance = new $modelClass($attributes);
        return $instance;
    }
public function mutate($name, $attributes)
    {
        // snake_case to camelCase
        $modelClass = "\\NEM\\Models\\" . Str::studly($name);

        if (!class_exists($modelClass)) {
            throw new BadMethodCallException("Model class '" . $modelClass . "' could not be found in \\NEM\\Model namespace.");
        }

        //XXX add fields list to Models
        $instance = new $modelClass($attributes);
        return $instance;
    }
public function mutate ( $ name , $ attributes ) { // snake_case to camelCase $ modelClass = "\\NEM\\Models\\" . Str :: studly ( $ name ) ; if ( ! class_exists ( $ modelClass ) ) { throw new BadMethodCallException ( "Model class '" . $ modelClass . "' could not be found in \\NEM\\Model namespace." ) ; } //XXX add fields list to Models $ instance = new $ modelClass ( $ attributes ) ; return $ instance ; }
Mutate a Model object.

This method takes a *snake_case* model name and converts it
to a class name in the namespace \NEM\Models.

@internal
@param  string   $name           The model name you would like to create.
@param  array    $attributes     The model's attribute values.
@return \NEM\Models\ModelInterface
Mutate a Model object .