簡體   English   中英

即使在laravel中也沒有找到視圖

[英]View not being found even though it exists in laravel

我對某個觀點有疑問,除此觀點外,其他觀點也對我有用。 這是它的路線

Route::get('/profile/avatarupload', [
    'uses' => '\App\Http\Controllers\ProfileController@getAvatarUpload',
    'as' => 'profile.avatar',
]);

ProfileController中的方法

public function getAvatarUpload()
    {
        return view('profile.avatar');
    }

導航欄的片段,當用戶單擊時,我將其稱為路由

<li><a href="{{ route('profile.avatar') }}">Update Avatar</a></li>

該視圖在文件結構中如下所示: views/profile/avatarupload.blade.php

最后,這是我在導航欄中單擊“更新頭像”時收到的錯誤代碼

InvalidArgumentException in FileViewFinder.php line 137:
View [profile.avatar] not found. 

您正在混合路線名稱和視圖名稱。 它們不是同一件事。

如果您的視圖位於resources/views/profile/avatarupload.blade.phpresources/views/profile/avatarupload.blade.php return view('profile.avatarupload');

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM