77use Auth ;
88use Illuminate \Support \Facades \View ;
99use Route ;
10+ use Str ;
1011
1112class BaseController extends Controller
1213{
@@ -160,7 +161,7 @@ public function navigation()
160161
161162 // Add each navigation item the user has access to
162163 foreach ($ this ->user ['modules ' ] as $ id => $ item ) {
163- $ response .= $ this ->navigationLI ($ id == $ this ->slug , str_slug ($ id ), $ item ['title ' ], $ item ['icon ' ]);
164+ $ response .= $ this ->navigationLI ($ id == $ this ->slug , Str:: slug ($ id ), $ item ['title ' ], $ item ['icon ' ]);
164165 if (isset ($ item ['sub_navigation ' ]) && isset ($ item ['treeview ' ]) && class_exists ($ item ['model ' ])) {
165166 $ data = new $ item ['model ' ];
166167 $ data = $ this ->sortModel ($ data , @$ item ['orderByDesc ' ], 'desc ' );
@@ -175,9 +176,9 @@ public function navigation()
175176 if ((new $ item ['model ' ])->where ($ item ['treeview ' ], $ subitem ->id )->count ()) {
176177 $ count ++;
177178 if ($ count == 1 && isset ($ item ['sub_showall ' ]) && $ item ['sub_showall ' ]) {
178- $ subresponse .= $ this ->navigationLI ($ id == $ this ->slug && !request ()->root , str_slug ($ id ), $ item ['sub_showall ' ] === true ? trans ('admin::base.showall ' ) : $ this ->locale ('sub_showall ' , $ item , false )) . '</li> ' ;
179+ $ subresponse .= $ this ->navigationLI ($ id == $ this ->slug && !request ()->root , Str:: slug ($ id ), $ item ['sub_showall ' ] === true ? trans ('admin::base.showall ' ) : $ this ->locale ('sub_showall ' , $ item , false )) . '</li> ' ;
179180 }
180- $ subresponse .= $ this ->navigationLI ($ id == $ this ->slug && request ()->root == $ subitem ->id , str_slug ($ id ) . '?root= ' . $ subitem ->id , $ subitem [$ item ['sub_navigation ' ]]) . '</li> ' ;
181+ $ subresponse .= $ this ->navigationLI ($ id == $ this ->slug && request ()->root == $ subitem ->id , Str:: slug ($ id ) . '?root= ' . $ subitem ->id , $ subitem [$ item ['sub_navigation ' ]]) . '</li> ' ;
181182 }
182183 }
183184 $ subresponse .= '</ul> ' ;
0 commit comments