44use Illuminate \Support \ServiceProvider ;
55use Illuminate \Support \Str ;
66
7- class HoneypotServiceProvider extends ServiceProvider {
7+ class HoneypotServiceProvider extends ServiceProvider
8+ {
89
910 /**
1011 * Indicates if loading of the provider is deferred.
@@ -20,8 +21,7 @@ class HoneypotServiceProvider extends ServiceProvider {
2021 */
2122 public function register ()
2223 {
23- $ this ->app ->singleton ('honeypot ' , function ($ app )
24- {
24+ $ this ->app ->singleton ('honeypot ' , function ($ app ) {
2525 return new Honeypot ;
2626 });
2727 }
@@ -33,16 +33,13 @@ public function register()
3333 */
3434 public function boot ()
3535 {
36- if ($ this ->isLaravelVersion ('4 ' ))
37- {
36+ if ($ this ->isLaravelVersion ('4 ' )) {
3837 $ this ->package ('msurguy/honeypot ' );
39- }
40- elseif ($ this ->isLaravelVersion ('5 ' ))
41- {
38+ } elseif ($ this ->isLaravelVersion ('5 ' ) || $ this ->isLaravelVersion ('6 ' )) {
4239 $ this ->loadTranslationsFrom (__DIR__ . '/../../lang ' , 'honeypot ' );
4340 }
4441
45- $ this ->app ->booted (function ($ app ) {
42+ $ this ->app ->booted (function ($ app ) {
4643
4744 // Get validator and translator
4845 $ validator = $ app ['validator ' ];
@@ -51,7 +48,6 @@ public function boot()
5148 // Add honeypot and honeytime custom validation rules
5249 $ validator ->extend ('honeypot ' , 'honeypot@validateHoneypot ' , $ translator ->get ('honeypot::validation.honeypot ' ));
5350 $ validator ->extend ('honeytime ' , 'honeypot@validateHoneytime ' , $ translator ->get ('honeypot::validation.honeytime ' ));
54-
5551 });
5652 }
5753
0 commit comments