title: How to pass in data into the Artisan handle command - Laravel 5.2
body: <p>I would I pass data into my handle method I made in my Artisan Command?</p>
  
  <p>This is what I have so far: 
  ( If I DD something in the handle method, it works, so its linking with the Artisan Command )</p>
  
  <p>Controller:</p>
  
  <pre><code>public function update(Request $request, $slug) {
  
          // Get the user assocated with Listing, and also get the slug of listing.
          $listing = $request-&gt;user()-&gt;listings()-&gt;where('slug', $slug)-&gt;first();
  
          // Flash success message after every update
          Message::set('Alright!', 'Your changes were saved successfully.');
  
  
  
          Artisan::call('emails:sendIfGuideUpdated');
  
  // More code here...
  }
  </code></pre>
  
  <p>My Artisan Command that I made to handle sending the emails:</p>
  
  <pre><code>class SendEmails extends Command
  {
      /**
       * The name and signature of the console command.
       *
       * @var string
       */
      protected $signature = 'emails:sendIfGuideUpdated';
  
      /**
       * The console command description.
       *
       * @var string
       */
      protected $description = 'Send out an email every minute to users that have favored a guide when that Guide updates their Listing';
  
      public $listing;
  
  
      /**
       * Create a new command instance.
       *
       * @return void
       */
      public function __construct(Listing $listing)
      {
          $this-&gt;listing = $listing;
  
          parent::__construct();
      }
  
      /**
       * Execute the console command.
       *
       * @return mixed
       */
      public function handle()
      {
          // Get the data from the Guide Listing that was updated
  
          $name = $this-&gt;listing-&gt;name;
          dd($name);
  
          // Send an email to the Admin notifying that a comment was made under a blog post.
  
      }
  }
  </code></pre>
  
  <p>And this is my Kernal file that will handle when the emails get sent out:</p>
  
  
  
  <pre class="lang-html prettyprint-override"><code>class Kernel extends ConsoleKernel
  {
      /**
       * The Artisan commands provided by your application.
       *
       * @var array
       */
      protected $commands = [
           Commands\Inspire::class,
           Commands\SendEmails::class,
      ];
  
      /**
       * Define the application's command schedule.
       *
       * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
       * @return void
       */
      protected function schedule(Schedule $schedule)
      {
          $schedule-&gt;command('emails:sendIfGuideUpdated')-&gt;everyMinute();
      }
  }
  </code></pre>
  
  <p>Im having trouble passing in the Listing information into to handle method. What is the correct way of doing this?</p>