0
的UrlGenerator拋出一個異常Laravel授權拋出一個錯誤在刀片模板使用時
ErrorException in UrlGenerator.php line 337:
Action App\Http\Controllers\[email protected] not defined.
我在ProductPolicy
有這樣的代碼在我的刀片產品視圖@can('view', App\Product::class)
<a href="{{ action('[email protected]', 1) }}">Product View</a>
@endcan
所以我在AuthServiceProvider類中註冊了產品策略
protected $policies = [
Product::class => ProductPolicy::class
];
請出示你的'ProductController'和'web.php' –
我使用的資源'路線::資源( '產品', 'ProductController的');' –