@@ -23,16 +23,22 @@ class Provider extends ServiceProvider
23
23
*/
24
24
public function boot (Router $ router )
25
25
{
26
+ $ langPath = 'vendor/firewall ' ;
27
+
28
+ $ langPath = (function_exists ('lang_path ' ))
29
+ ? lang_path ($ langPath )
30
+ : resource_path ('lang/ ' .$ langPath );
31
+
26
32
$ this ->publishes ([
27
33
__DIR__ . '/Config/firewall.php ' => config_path ('firewall.php ' ),
28
34
__DIR__ . '/Migrations/2019_07_15_000000_create_firewall_ips_table.php ' => database_path ('migrations/2019_07_15_000000_create_firewall_ips_table.php ' ),
29
35
__DIR__ . '/Migrations/2019_07_15_000000_create_firewall_logs_table.php ' => database_path ('migrations/2019_07_15_000000_create_firewall_logs_table.php ' ),
30
- __DIR__ . '/Resources/lang ' => resource_path ( ' lang/vendor/firewall ' ) ,
36
+ __DIR__ . '/Resources/lang ' => $ langPath ,
31
37
], 'firewall ' );
32
38
33
39
$ this ->registerMiddleware ($ router );
34
40
$ this ->registerListeners ();
35
- $ this ->registerTranslations ();
41
+ $ this ->registerTranslations ($ langPath );
36
42
$ this ->registerCommands ();
37
43
}
38
44
@@ -91,15 +97,11 @@ public function registerListeners()
91
97
*
92
98
* @return void
93
99
*/
94
- public function registerTranslations ()
100
+ public function registerTranslations ($ langPath )
95
101
{
96
- $ lang_path = resource_path ( ' lang/vendor/ firewall ' );
102
+ $ this -> loadTranslationsFrom ( __DIR__ . ' /Resources/lang ' , ' firewall ' );
97
103
98
- if (is_dir ($ lang_path )) {
99
- $ this ->loadTranslationsFrom ($ lang_path , 'firewall ' );
100
- } else {
101
- $ this ->loadTranslationsFrom (__DIR__ . '/Resources/lang ' , 'firewall ' );
102
- }
104
+ $ this ->loadTranslationsFrom ($ langPath , 'firewall ' );
103
105
}
104
106
105
107
public function registerCommands ()
0 commit comments