@@ -10,28 +10,31 @@ class Link extends Model {
10
10
protected $ table = 'links ' ;
11
11
12
12
static $ cache = [];
13
- public static function allCached ($ forceRefresh = false )
13
+ public static function getAllLinks ($ forceRefresh = false ) // allCached(
14
14
{
15
15
if (!isset (self ::$ cache ['all ' ]) || $ forceRefresh ) {
16
16
self ::$ cache ['all ' ] = Link::all ();
17
17
}
18
18
return self ::$ cache ['all ' ];
19
19
}
20
- public static function returnUrls ($ forceRefresh = false ) {
20
+ public static function getUrls ($ forceRefresh = false ) // returnUrls(
21
+ {
21
22
if (!isset (self ::$ cache ['all_urls ' ]) || $ forceRefresh ) {
22
23
$ configs = Link::allCached ($ forceRefresh );
23
24
self ::$ cache ['all_urls ' ] = $ configs ->pluck ('url ' )->toArray ();
24
25
}
25
26
return self ::$ cache ['all_urls ' ];
26
27
}
27
- public static function getMainUrls ($ forceRefresh = false ){
28
+ public static function getMainUrls ($ forceRefresh = false )
29
+ {
28
30
if (!isset (self ::$ cache ['main_urls ' ]) || $ forceRefresh ) {
29
31
$ configs = Link::where ('main ' , '= ' , true )->get (['url ' ]);
30
32
self ::$ cache ['main_urls ' ] = $ configs ->pluck ('url ' )->toArray ();
31
33
}
32
34
return self ::$ cache ['main_urls ' ];
33
35
}
34
- public function getAndSave ($ url , $ label , $ visibility ){
36
+ public function addNewLink ($ url , $ label , $ visibility ) // getAndSave(
37
+ {
35
38
$ this ->url = $ url ;
36
39
$ this ->display = $ label ;
37
40
$ this ->show_menu = $ visibility ;
0 commit comments