class ModelAliasAutoloader
Lets tinker users reference Eloquent models by their short name — e.g.
`User::find(1)` instead of `Flarum\User\User::find(1)`. Registered as a fallback autoloader, so it only runs when PHP fails to resolve a class by its given (short) name. On the first miss it indexes every registered PSR-4 root (core, extensions, and other Composer packages) by short name; when a bare name is requested it aliases the matching Eloquent model into the global namespace. This means third-party extension models are covered automatically, with no hardcoded list. The index is built once and cached for the lifetime of the shell.
Properties
Methods
Details
at
line 52
static ModelAliasAutoloader|null
register(Closure $writeln)
at
line 72
void
unregister()
Remove this autoloader. Safe to call more than once.