title: How can I get the current user executing a Laravel Command?
body: <p>I am trying to build a custom configuration that gets added to my Laravel configuration at boot up. I created an artisan command that allows the developers to place the server into 'test' mode and 'live' mode. This should then force API's to use test keys rather than live keys which works fine.</p>
  
  <pre><code>public function handle()
  {
      switch(strtoupper($this-&gt;argument('m'))) {
          case 'LIVE':
              \DB::table('server_mode')-&gt;where('id', 1)-&gt;update([
                  'mode' =&gt; true,
                  'verified_by' =&gt; 'Server'
              ]);
              $this-&gt;info('Server is now in LIVE mode');
              break;
          case 'TEST':
              \DB::table('server_mode')-&gt;where('id', 1)-&gt;update([
                  'mode' =&gt; false,
                  'verified_by' =&gt; 'Server'
              ]);
              $this-&gt;info('Server is now in TEST mode');
              break;
          default:
              $this-&gt;error('Please enter either LIVE or TEST');
              break;
      }
  }
  </code></pre>
  
  <p>The problem is, I want to add which developer changed the status. So far, it is hard coded to 'Server'. Is it possible to get the IP or PC information who'm executed the command to store in the DB?</p>