請幫我一點忙。我正在嘗試按照官方文件為我的 Laravel 應用程式設定護照。但我陷入了在呼叫 Passport::routes() 之前需要檢查的步驟。我的 vscode 顯示錯誤
未定義的方法:routesAreCached()
即使當我追溯到基本抽象類別ServiceProvider.php時,那裡的程式碼似乎呼叫 $this->app->routesAreCached() 沒有任何問題。下面是我的 AppProvidersAuthServiceProvider.php 程式碼。
<?php
namespace AppProviders;
use IlluminateFoundationSupportProvidersAuthServiceProvider as ServiceProvider;
use IlluminateSupportFacadesGate;
use LaravelPassportPassport;
class AuthServiceProvider extends ServiceProvider
{
/**
* The model to policy mappings for the application.
*
* @var array<class-string, class-string>
*/
protected $policies = [
// 'AppModelsModel' => 'AppPoliciesModelPolicy',
];
/**
* Register any authentication / authorization services.
*
* @return void
*/
public function boot()
{
$this->registerPolicies();
/**
* This method will register the routes necessary to issue access tokens and revoke access tokens, clients, and personal access tokens:
*
*/
if (! $this->app->routesAreCached()) { // error at this line
Passport::routes();
}
}
}
Your Answer
2 個答案
Hot Questions
function_exists()無法判定自訂函數
2024-04-29 11:01:01
google 瀏覽器 手機版顯示的怎麼實現
2024-04-23 00:22:19
子窗口操作父窗口,輸出沒反應
2024-04-19 15:37:47
父視窗沒有輸出
2024-04-18 23:52:34
關於CSS心智圖的課件在哪?
2024-04-16 10:10:18
Hot Tools
vc9-vc14(32+64位元)運行庫合集(連結在下方)
phpStudy安裝所需運行函式庫集合下載
VC9 32位
VC9 32位元 phpstudy整合安裝環境運行庫
php程式設計師工具箱完整版
程式設計師工具箱 v1.0 php整合環境
VC11 32位
VC11 32位元 phpstudy整合安裝環境運行庫
SublimeText3漢化版
中文版,非常好用
熱門話題
抖音等級價目表1-75
20337
7
20337
7
wifi顯示無ip分配
13531
4
13531
4
虛擬手機號碼接收驗證碼
11851
4
11851
4
gmail信箱登陸入口在哪裡
8836
17
8836
17
windows安全中心怎麼關閉
8420
7
8420
7
熱門文章
2025年加密貨幣市場十大趨勢預測:下一個風口在哪裡?
2025-11-07
By DDD
幣圈土狗項目如何識別?避免歸零幣的陷阱與風險預警
2025-11-07
By DDD
解決CSS @media 查詢優先級與規則覆蓋問題的教程
2025-11-07
By DDD
win10字體安裝後在軟件裡找不到怎麼辦_win10字體安裝與識別方法
2025-11-07
By DDD
鐵路12306支付失敗訂單還在嗎_鐵路12306支付失敗訂單處理方法
2025-11-07
By DDD





