Seems commands __construct() is called during composer dump autoload

This commit is contained in:
Deon George 2021-12-07 14:57:46 +11:00
parent 7ee2df607c
commit 1a5371a7b9

View File

@ -28,15 +28,6 @@ class SlackSocketClient extends Command
*/
protected $description = 'Start SocketMode Client';
public function __construct()
{
// Make sure our socket_token is defined
if (! config('slack.socket_token'))
throw new \Exception('SocketMode Client Token not defined.');
parent::__construct();
}
/**
* Execute the console command.
*
@ -45,6 +36,10 @@ class SlackSocketClient extends Command
*/
public function handle()
{
// Make sure our socket_token is defined
if (! config('slack.socket_token'))
throw new \Exception('SocketMode Client Token not defined.');
$loop = Loop::get();
$client = new SocketMode($loop);