Custom Issues
The plugin ships advanced Laravel-aware static analysis checks that extend Psalm’s built-in diagnostics:
- NoEnvOutsideConfig —
env()called outside the application’s config directory - InvalidConsoleArgumentName —
argument()references undefined console command argument - InvalidConsoleOptionName —
option()references undefined console command option - MissingView — a view name passed to
view(),Factory,ResponseFactory,Router,MailMessage, orTestResponsemethods references a non-existent Blade template (reported at error levels 1 to 4) - MissingTranslation —
__()ortrans()references an undefined translation key (opt-in) - UnconfiguredFilesystemDisk —
Storage::disk()/drive()references a disk name not present infilesystems.disks(reported at error levels 1 to 4) - SerializedQueuedModel — a queued class holds an Eloquent model in a property without reaching
SerializesModels, so the whole model is written into the queue payload (reported at error levels 1 to 4) - ModelMakeDiscouraged —
Model::make()used instead ofnew Model() - OctaneIncompatibleBinding —
singleton()closure resolves a request-scoped service such as Request, Session, or Auth (auto-enabled whenlaravel/octaneis installed) - PublicModelScope —
public#[Scope]Eloquent query scope, whose static call is a runtime fatal (reported at error levels 1 to 4) - PublicModelAccessor —
publiclegacygetXxxAttribute()/setXxxAttribute()accessor or mutator, a pure convention nit (reported at error level 1) - ImplicitQueryBuilderCall — a query builder or local scope method called directly on a model instead of through an explicit
query()entry point (opt-in) - UnknownModelAttribute — a typo’d key passed to a model’s
create()/fill()/update(), or to a builder or relation creation call (Post::query()->create(),$user->posts()->createMany()), that matches no known attribute (reported at error levels 1 to 4) - UnresolvableAppendedModelAttribute — an Eloquent
$appendsentry with no backing accessor or class cast, a runtimeBadMethodCallExceptionontoArray()/toJson() - UndefinedModelRelation — a relation name passed to
with(),load(),has(),whereHas(), and similar methods that does not resolve to a relationship on the model - MissingViewData: a Blade template declares a variable (
@vardocblock,@props) that theview()call site rendering it never passes (needs Blade analysis) - InvalidViewData: the value passed for a Blade template variable does not satisfy the type that template declares for it (needs Blade analysis)
- BladeCompileError: a template failed to compile and was excluded from analysis (needs Blade analysis)
- UnusedViewData: a
view()call site passes a data key that neither the rendered template nor anything it includes reads or declares (needs Blade analysis) - UnregisteredRouteName —
route(),to_route(),URL::route(),Redirect::route(),redirect()->route(), orurl()->route()references a route name that is not registered (opt-in)
Each issue page explains what it detects, why it matters, and how to fix it.
Table of contents
- NoEnvOutsideConfig
- InvalidConsoleArgumentName
- InvalidConsoleOptionName
- MissingView
- MissingTranslation
- ModelMakeDiscouraged
- SerializedQueuedModel
- OctaneIncompatibleBinding
- PublicModelScope
- PublicModelAccessor
- ImplicitQueryBuilderCall
- UndefinedModelRelation
- UnknownModelAttribute
- UnresolvableAppendedModelAttribute
- InvalidViewData
- MissingViewData
- UnconfiguredFilesystemDisk
- UnregisteredRouteName
- UnusedViewData
- BladeCompileError