Laravel throws View [name] not found
InvalidArgumentException: View [admin.profile] not found.Short answer
The name passed to view() must match a file under resources/views, written with dots instead of slashes and without the .blade.php ending. Check the path against that rule first. Packages add one more rule: their views need a namespace prefix like courier::dashboard.
Fix it fast
1Find out which cause you have
Turn the name in the message into a path and see whether that file exists. admin.profile must be resources/views/admin/profile.blade.php.
find resources/views -name '*.blade.php' | sort2Match what you see, then jump to its fix
What does the error look like?
InvalidArgumentException: View [admin.profile] not found.View [pages.home] not found
Cause 1 of 2
The view name does not match the file path
1Check
Views live in resources/views with the .blade.php extension, and nested folders are written with dot notation. Directory names should not contain a dot. A slash, a typo or a leftover extension in the name all miss the file.
php artisan tinker
>>> Illuminate\Support\Facades\View::exists('admin.profile')2Fix
Rename the file or fix the name so both agree.
// resources/views/admin/profile.blade.php
return view('admin.profile', $data);
// not: view('admin/profile.blade.php')3Verify
View::exists now returns true.
php artisan tinker
>>> Illuminate\Support\Facades\View::exists('admin.profile')Confirmed by laravel.com
Cause 2 of 2
A package view is requested without its namespace
1Check
Package views are referenced as package::view. If the package views were published into your app, they sit under resources/views/vendor/<package>.
ls resources/views/vendor 2>/dev/null2Fix
Use the namespaced name the package registered.
Route::get('/dashboard', function () {
return view('courier::dashboard');
});3Verify
The route renders the package view.
curl -I http://localhost:8000/dashboardConfirmed by laravel.com
How do I stop it coming back?
- Create views with php artisan make:view so the name and path match.
- Keep folder names free of dots.
- Check View::exists in a test for any view chosen at runtime.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
Related fixes
Back end
Composer says the gd extension is missing on a Laravel project
composer install or composer update stops on a package that requires ext-gd
Composer refuses to install a package that requires ext-gd when the PHP binary running Composer has no GD extension.
4 causes, each with a fixBack end
composer require maatwebsite/excel fails to install
Composer says the package needs an older PHP than the one installed
Composer refuses maatwebsite/excel when the PHP version or a PHP extension does not match what the package and PhpSpreadsheet need.
3 causes, each with a fixBack end
composer install says the lock file is not compatible and asks for update
Your lock file does not contain a compatible set of packages. Please run composer update.
composer install checked the locked packages against this machine's PHP and extensions and found a conflict.
3 causes, each with a fixBack end
composer require laravel/horizon fails: ext-pcntl is missing
laravel/horizon v1.1.0 requires ext-pcntl * -> the requested PHP extension pcntl is missing from your system
Horizon needs the pcntl extension, and Composer refuses to install it where PHP lacks that extension.
3 causes, each with a fixBack end
composer require laravel/passport stops with 'requirements could not be resolved'
... but these were not loaded, likely because it conflicts with another require.
Composer found no Passport release that fits your project at once.
4 causes, each with a fixBack end
Composer says the root composer.json requires a PHP version your PHP does not satisfy
Your requirements could not be resolved to an installable set of packages.
Composer compares the php constraint in your composer.json, or in a package, with the PHP that runs Composer.
3 causes, each with a fix