Get the fully-qualified model class name.

@param  string  $model
@return string

@throws \InvalidArgumentException
547206
protected function parseModel($model)
    {
        if (preg_match('([^A-Za-z0-9_/\\\\])', $model)) {
            throw new InvalidArgumentException('Model name contains invalid characters.');
        }

        $model = trim(str_replace('/', '\\', $model), '\\');

        if (! Str::startsWith($model, $rootNamespace = $this->laravel->getNamespace())) {
            $model = $rootNamespace.$model;
        }

        return $model;
    }
184813
protected function getModelFieldPrefix($model)
    {
        return (get_class($this->owner) != get_class($model)) ? get_class($this->owner) . '.' : '';
    }
183887
final protected function loadSubModel($model)
    {
        if (is_file($this->validSubModels[ $model ])) {
            $className = '\\' . get_called_class() . '\\' . ucfirst($model);
            $className = str_replace('\Base\\Model', '\Models', $className);

            if (class_exists($className)) {
                $this->{$model} = new $className();
            }
        }

        return $this->{$model};
    }
612655
public static function model($model = null)
    {
        if ($model) {
            self::$_model = $model;
        }

        if (!self::$_model) {
            self::$_model = TableRegistry::get('Settings.Configurations');
        }

        return self::$_model;
    }
405346
public function getTableInfo($model)
    {
        $table = $this->getTableName($model);

        return \DB::getDoctrineSchemaManager()->listTableDetails($table)->getColumns();
    }
876469
public function save($model)
    {
        if ($model instanceof Collection || is_array($model)) {
            throw new InvalidArgumentException('Parameter $model must be an instance of \Illuminate\Database\Eloquent\Model');
        }

        $this->validation()->validate('save', $model->getAttributes());

        $this->beforeSaveModel($model);

        return $model->save();
    }
490068
public static function getName($code)
    {
        if (!isset(self::$codesDescriptions[$code])) {
            throw new InvalidArgumentException("Invalid code $code specified");
        }

        return self::$codesDescriptions[$code];
    }
530244
public function getModel($model) {
        $this->_normalizeModel($model);
        $langSuffix = ucfirst(strtolower($this->_language));
        // Sanity check: is the model already localized?
        if ($this->_modelIsLocalized($model)) {
            throw new Garp_I18n_ModelFactory_Exception_ModelAlreadyLocalized(
                "Looks like model $model is already internationalized."
            );
        }
        $modelName = $model.$langSuffix;
        $model = new $modelName();
        return $model;
    }
90496
protected function parseModel($model)
    {
        if (false === strpos($model, '\\')) {
            $path = explode('\\', static::class);
            array_pop($path);
            array_push($path, Db::parseName($model, 1));
            $model = implode('\\', $path);
        }

        return $model;
    }
1299425
protected function parseModel($model)
    {
        if (isset($this->alias[$model])) {
            $model = $this->alias[$model];
        }

        if (false === strpos($model, '\\')) {
            $path = explode('\\', get_class($this->parent));
            array_pop($path);
            array_push($path, Db::parseName($model, 1));
            $model = implode('\\', $path);
        }

        return $model;
    }
900185
public function getModelClass(string $modelName): ?string
    {
        if (isset($this->models[$modelName])) {
            return $this->models[$modelName];
        }

        return null;
    }
722439
public static String getClassNameFromTableModel(TableModel model) {
		DialectException.assureNotNull(model, "TableModel can not be null");
		String className;
		if (model.getEntityClass() != null)
			className = model.getEntityClass().getSimpleName();
		else {
			DialectException.assureNotEmpty(model.getTableName(), "TableName can not be empty in TableModel");
			className = StrUtils.toUpperCaseFirstOne(transColumnNameToFieldName(model.getTableName()));
		}
		DialectException.assureNotEmpty(className, "TableName can not be empty in TableModel");
		return className;
	}
881428
public function model(Model $model)
    {
        // Check if the model is searchable before setting the query builder model
        $traits = class_uses_recursive(get_class($model));

        if (!isset($traits[Searchable::class])) {
            throw new InvalidArgumentException(get_class($model).' does not use the searchable trait');
        }

        $this->model = $model;

        return $this;
    }
285931
public function getGroupName(Model $model) {
		$modelNamePlural = $this->getModelNamePlural($model);
		$groupNameCamel = Inflector::humanize(Inflector::underscore($modelNamePlural));
		$groupName = mb_ucfirst(mb_strtolower($groupNameCamel));

		return $groupName;
	}
248759
public function getModel($model)
    {
        $model = str_replace(':', '\\', $model);

        if (!class_exists($model)) {
            throw new ModelNotFoundException($model);
        }

        return new $model($this);
    }
243104
public function getModel($model = null)
    {
        if ($model === null) {
            $model = $this->crudApi->model;
        }

        if ($model === null) {
            return false;
        }

        // Make Sure model name is uppercased.
        $model = ucfirst($model);

        // If namespace is not detected or set then set to the laravel default of App.
        if ($this->crudApi->namespace === null) {
            $this->crudApi->setNamespace('App\\');
        }


        // Test conventional namespace model combinations
        $conventions = [
            $this->crudApi->namespace . $model,
            $this->crudApi->namespace . 'Models\\' . $model
        ];

        foreach ($conventions as $fqModel) {
            if (class_exists($fqModel)) {
                return $fqModel;
            }
        }

        try {
            // If not conventional, try configurable
            $additionalNamespaces = $this->getAdditionalNamespaces();
            if (!empty($additionalNamespaces)) {
                foreach ($additionalNamespaces as $ns) {
                    $fqModel = $ns . $model;
                    if (class_exists($fqModel)) {
                        return $fqModel;
                    }
                }
            }
        } catch (\Exception $e) {
            return false;
        }

        return false;
    }
1319030
protected function buildModel($model)
    {
        try {
            $query = $this->resolveQueryBuilderFromModel($model);
        } catch (InvalidArgumentException $e) {
            $query = $model;
        }

        if ($this->paginate === true && \method_exists($query, 'paginate')) {
            $query = $query->paginate($this->perPage, ['*'], $this->pageName);
        } elseif ($this->isQueryBuilder($query)) {
            $query = $query->get();
        }

        return $query;
    }