0
PHPを使用してnavbarを生成するプラグインがあります。フォルダは、プロジェクト内にある/ configに/ menu.phpLaravelのconfigフォルダにあるモデルを使用できません
それは次のようになります。
私はいくつかのモデル情報を追加したい<?php
return [
//HORIZONTAL MENU LAYOUT - MENU
'horizontal' => [
[
'title' => 'bar',
'link' => '/bar/all',
'active' => 'bar*',
'icon' => 'fa fa-sign-in',
],
[
'title' => 'foo',
'link' => '/foo/all',
'active' => 'foo*',
'icon' => 'fa fa-sign-out',
],
]
];
。
<?php
use Auth;
$id = Auth::user()->id;
return [
//HORIZONTAL MENU LAYOUT - MENU
'horizontal' => [
[
'title' => 'bar',
'link' => '/bar/'. $id,
'active' => 'bar*',
'icon' => 'fa fa-sign-in',
],
[
'title' => 'foo',
'link' => '/foo/all',
'active' => 'foo*',
'icon' => 'fa fa-sign-out',
],
]
];
が、私はこのエラーを取得する:Class 'Auth' not found
この
は私の試みです。私はまた、モデルで試してみました:私はここにこれらのモデルを使用するにはどうすればよいCall to a member function connection() on null
:
$model = \App\Model::count();
私は、このエラーを与えますか?