public function then(callable $fn, $runInBackground = false)
    {
        $this->after = $fn;
        // Force the job to run in foreground
        if ($runInBackground === false) {
            $this->inForeground();
        }

        return $this;
    }
public function then(callable $fn, $runInBackground = false)
    {
        $this->after = $fn;
        // Force the job to run in foreground
        if ($runInBackground === false) {
            $this->inForeground();
        }

        return $this;
    }
public function then ( callable $ fn , $ runInBackground = false ) { $ this -> after = $ fn ; // Force the job to run in foreground if ( $ runInBackground === false ) { $ this -> inForeground ( ) ; } return $ this ; }
Set a function to be called after job execution.
By default this will force the job to run in foreground
because the output is injected as a parameter of this
function, but it could be avoided by passing true as a
second parameter. The job will run in background if it
meets all the other criteria.

@param  callable $fn
@param  bool $runInBackground
@return self
Set a function to be called after job execution . By default this will force the job to run in foreground because the output is injected as a parameter of this function but it could be avoided by passing true as a second parameter . The job will run in background if it meets all the other criteria .