| title | MissingView |
|---|---|
| parent | Custom Issues |
| nav_order | 4 |
Emitted when view() or Factory::make() (e.g., view()->make()) references a Blade template that does not exist on disk.
Facade calls like View::make() are not currently detected (see #591).
If the referenced view file doesn't exist, Laravel throws an InvalidArgumentException at runtime.
This check catches typos and missing templates during static analysis.
// Bad — typo in the view name
view('emails.welcom'); // MissingView
// Good — the view file exists
view('emails.welcome');// Bad — referencing a deleted template
view('admin.old-dashboard'); // MissingView
// Good
view('admin.dashboard');- Check that the Blade file exists at the expected path (e.g.,
resources/views/emails/welcome.blade.php) - Fix any typos in the view name
- If the view is provided by a package, use the namespaced syntax (e.g.,
view('package::view.name')) — namespaced views are not checked by this rule
This check is disabled by default. Enable it in your psalm.xml:
<plugins>
<pluginClass class="Psalm\LaravelPlugin\Plugin">
<findMissingViews value="true" />
</pluginClass>
</plugins>- Only string literal view names are checked — dynamic or concatenated names are skipped
- Namespaced views (e.g.,
mail::html.header) are skipped - Only
.blade.phpand.phpextensions are checked - Only view paths known at boot time are searched (
config('view.paths')plus paths added by service providers)