我使用Laratrust和嘗試工具: 我創建這些文件聯繫LTE與Laratrust
應用程序\ MyMenuFilter.php
<?php
namespace App;
use JeroenNoten\LaravelAdminLte\Menu\Builder;
use JeroenNoten\LaravelAdminLte\Menu\Filters\FilterInterface;
class MyMenuFilter implements FilterInterface
{
public function transform($item, Builder $builder)
{
if (isset($item['permission']) && Laratrust::can($item['permission'])) {
return false;
}
return $item;
}
}
我改變了這種 配置\ adminlte.php
'menu' => [
'MAIN NAVIGATION',
[
'text' => 'Blog',
'url' => 'admin/blog',
'permission' => 'create-post', // Here
],
#code
]
'filters' => [
#code
//JeroenNoten\LaravelAdminLte\Menu\Filters\GateFilter::class,
App\MyMenuFilter::class,
],
但顯示此錯誤:
Class'App \ La ratrust」未找到(查看:/var/www/html/multi-auth/vendor/jeroennoten/laravel-adminlte/resources/views/page.blade.php)