title: Laravel 5.1 - Return Data from Jobs?
body: <p>I'm just starting to use Jobs in Laravel 5.1 and am wondering if it's a good practice to return data from a Job?  I haven't seen any examples of that, but here's a scenario.  Lets say its an internal Messaging System between Users:</p>
  
  <pre><code>// Controller Method 
  public function store(Request $request)
  {
       if (!$this-&gt;messageValidator-&gt;isValid($request-&gt;all())) {
            return redirect()-&gt;back()-&gt;withInput()-&gt;withErrors($this-&gt;messageValidator-&gt;getErrors());
        }
  
        $this-&gt;dispatchFrom(PostMessage::class, $request, [ 'user' =&gt; Auth::user() ]);
  
        return redirect('messages');
  }
  </code></pre>
  
  <p>So the Job will take the request data and the User, and will perform several tasks</p>
  
  <pre><code>// In the PostMessage Job
  
  public function handle( // dependencies here)
   {
         // Create a new Thread
  
        //  Add Message to the Database
  
        // Store Recipients of Message in the Database 
  
        // Send email notifications to all involced
  
       return $message_id;
  }
  </code></pre>
  
  <p>At the end of the handle() method, I returned the $message_id so I can use it for a redirect in the controller:</p>
  
  <pre><code>return view('messages.show', $message_id);
  </code></pre>
  
  <p>Is this an acceptable practice, or are Jobs meant to perform tasks in a more isolated manner?</p>
  
  <p>Or is perhaps not a good use of Jobs?</p>