File tree 2 files changed +9
-4
lines changed
2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -70,5 +70,10 @@ function ($expression) {
70
70
public function register ()
71
71
{
72
72
$ this ->app ->bind ('timezone ' , Timezone::class);
73
+
74
+ $ this ->mergeConfigFrom (
75
+ __DIR__ . '/config/timezone.php ' ,
76
+ 'timezone '
77
+ );
73
78
}
74
79
}
Original file line number Diff line number Diff line change @@ -18,9 +18,9 @@ public function handle(Login $event)
18
18
$ ip = $ this ->getFromLookup ();
19
19
$ geoip_info = geoip ()->getLocation ($ ip );
20
20
21
- if ( auth ()->user ()-> timezone != $ geoip_info [ ' timezone ' ]) {
22
- if (config ( ' timezone.overwrite ' ) == true || auth ()-> user () ->timezone == null ) {
23
- $ user = auth ()-> user ();
21
+ $ user = auth ()->user ();
22
+ if ($ user ->timezone != $ geoip_info [ ' timezone ' ] ) {
23
+ if ( config ( ' timezone.overwrite ' ) == true || $ user-> timezone == null ) {
24
24
$ user ->timezone = $ geoip_info ['timezone ' ];
25
25
$ user ->save ();
26
26
@@ -70,7 +70,7 @@ public function notify(\Torann\GeoIP\Location $geoip_info)
70
70
return ;
71
71
}
72
72
}
73
-
73
+
74
74
/**
75
75
* @return mixed
76
76
*/
You can’t perform that action at this time.
0 commit comments