File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change 11<?php
22
33return [
4+ 'validate-sns-messages ' => env ('VALIDATE_SNS_MESSAGES ' , true ),
45 'sns-class-map ' => []
56];
Original file line number Diff line number Diff line change 33
44namespace MiamiOH \SnsHandler ;
55
6+ use Aws \Sns \MessageValidator ;
67use Illuminate \Support \ServiceProvider as BaseServiceProvider ;
78use MiamiOH \SnsHandler \Controllers \SnsMessageController ;
89
@@ -32,7 +33,13 @@ public function boot()
3233 public function register ()
3334 {
3435 $ this ->app ->make (SnsMessageController::class);
36+
3537 $ this ->mergeConfigFrom ($ this ->configPath , 'sns-handler ' );
38+
39+ if (!config ('sns-handler.validate-sns-messages ' )) {
40+ $ this ->app ->bind (MessageValidator::class, NullMessageValidator::class);
41+ }
42+
3643 $ this ->app ->bind (SnsTopicMapper::class, function () {
3744 return new SnsTopicMapper (config ('sns-handler.sns-class-map ' , []));
3845 });
You can’t perform that action at this time.
0 commit comments