Models Helper
This helper will provide information about general settings used in models, like namespace, directory, etc.
Models Helper is "macroable" and "collectable", which allows you to run batch methods and collect output with ModelsHelper::collect('dir', 'path')
Dir
/**
* Get models' directory name
* @return string
*/
ModelsHelper::dir(): voidPath
/**
* Get models' directory path
* Path is set optimistically - meaning: it does not check if any files exist inside or if those files are models.
* @return string
*/
ModelsHelper::path(): voidList
/**
* Get collection of models
* @param string|null $path
* @return Collection
*/
ModelsHelper::list(): voidClasses
/**
* Get list of models' classes
* @param string|null $path
* @return Collection
*/
ModelsHelper::classes(): voidNames
/**
* Get list of models' names
* @param string|null $path
* @return Collection
*/
ModelsHelper::names(): voidNamespace
/**
* Get most commonly used namespace
* @return string
*/
ModelsHelper::namespace(): voidFiles
/**
* Get list of models' files
* @param string|null $path
* @return Collection
*/
ModelsHelper::files(): voidUser
/**
* Get User model as defined in auth provider
* @return string
*/
ModelsHelper::user(): voidSearch
/**
* Search for model by an approximate name string. It will always return a closest model.
* @param string $name
* @return Model
*/
ModelsHelper::search(): voidClass
/**
* Build full class from name
* @param string $name
* @return string
*/
ModelsHelper::class(): voidTable
/**
* Get table from name
* @param string $name
* @return string
*/
ModelsHelper::table(): voidGet
/**
* Get class if one exists
* @param string $name
* @return Model|null
*/
ModelsHelper::get(): voidExists
/**
* Check if model exists
* @param string $name
* @return bool
*/
ModelsHelper::exists(): void