2
2
3
3
namespace Hexadog \MenusManager \Traits ;
4
4
5
+ use Closure ;
5
6
use Hexadog \MenusManager \Item ;
6
7
use Illuminate \Support \Collection ;
7
8
@@ -70,7 +71,7 @@ public function findBy(string $key, string $value): ?Item
70
71
*/
71
72
public function findByTitleOrAdd (string |\Closure $ title , array $ attributes = []): ?Item
72
73
{
73
- if (!($ item = $ this ->findBy ('title ' , $ title instanceof \ Closure ? $ title () : $ title ))) {
74
+ if (!($ item = $ this ->findBy ('title ' , $ title instanceof Closure ? $ title () : $ title ))) {
74
75
$ item = $ this ->add (compact ('title ' , 'attributes ' ));
75
76
}
76
77
@@ -80,7 +81,7 @@ public function findByTitleOrAdd(string|\Closure $title, array $attributes = [])
80
81
/**
81
82
* Add new header menu item.
82
83
*/
83
- public function header (string |\ Closure $ title , array $ attributes = []): Item
84
+ public function header (string |Closure $ title , array $ attributes = []): Item
84
85
{
85
86
return $ this ->add (compact ('title ' , 'attributes ' ))->asHeader ();
86
87
}
@@ -102,15 +103,15 @@ public function items()
102
103
*
103
104
* @param mixed $route
104
105
*/
105
- public function route ($ route , string |\ Closure $ title , array $ attributes = []): Item
106
+ public function route ($ route , string |Closure $ title , array $ attributes = []): Item
106
107
{
107
108
return $ this ->add (compact ('route ' , 'title ' , 'attributes ' ));
108
109
}
109
110
110
111
/**
111
112
* Register new menu item using url.
112
113
*/
113
- public function url (string $ url , string |\ Closure $ title , array $ attributes = []): Item
114
+ public function url (string $ url , string |Closure $ title , array $ attributes = []): Item
114
115
{
115
116
return $ this ->add (compact ('url ' , 'title ' , 'attributes ' ));
116
117
}
0 commit comments